Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Apr 15, 2024
1 parent f4cbb65 commit 69eb178
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
Class {
#name : #StargateConsulEchoRESTfulControllerTest,
#superclass : #SingleResourceRESTfulControllerTest,
#category : #'Stargate-Consul-Examples-Tests'
#name : 'StargateConsulEchoRESTfulControllerTest',
#superclass : 'SingleResourceRESTfulControllerTest',
#category : 'Stargate-Consul-Examples-Tests',
#package : 'Stargate-Consul-Examples-Tests'
}

{ #category : #'private - support' }
{ #category : 'private - support' }
StargateConsulEchoRESTfulControllerTest >> baseUrl [

^ 'http://api.example.com' asUrl
]

{ #category : #running }
{ #category : 'running' }
StargateConsulEchoRESTfulControllerTest >> setUpResourceController [

resourceController := StargateConsulEchoRESTfulController new
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulEchoRESTfulControllerTest >> testMessageText [

| response |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@
A StargateConsulExampleTest is a test class for testing the behavior of StargateConsulExample
"
Class {
#name : #StargateConsulExampleTest,
#superclass : #TestCase,
#name : 'StargateConsulExampleTest',
#superclass : 'TestCase',
#instVars : [
'application',
'port'
],
#category : #'Stargate-Consul-Examples-Tests'
#category : 'Stargate-Consul-Examples-Tests',
#package : 'Stargate-Consul-Examples-Tests'
}

{ #category : #running }
{ #category : 'running' }
StargateConsulExampleTest >> runCase [

self shouldnt: [ super runCase ] raise: Exit
]

{ #category : #running }
{ #category : 'running' }
StargateConsulExampleTest >> setUp [

super setUp.
port := self freeListeningTCPPort.
StargateConsulExample logsDirectory ensureCreateDirectory
]

{ #category : #running }
{ #category : 'running' }
StargateConsulExampleTest >> start: aLaunchpadApplication withAll: arguments [

String streamContents: [ :stream |
Expand All @@ -44,14 +45,14 @@ StargateConsulExampleTest >> start: aLaunchpadApplication withAll: arguments [
]
]

{ #category : #running }
{ #category : 'running' }
StargateConsulExampleTest >> tearDown [

application ifNotNil: [ application stop ].
super tearDown
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulExampleTest >> testDefaultServiceDiscoveryTimeSlotBetweenRetries [

self start: StargateConsulExample withAll: {
Expand All @@ -63,25 +64,25 @@ StargateConsulExampleTest >> testDefaultServiceDiscoveryTimeSlotBetweenRetries [
self assert: application serviceDiscoveryTimeSlotBetweenRetries equals: 100 milliSeconds
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulExampleTest >> testPrintHelpOn [

| help |

help := String streamContents: [ :stream | StargateConsulExample printHelpOn: stream ].

self assert: help equals: ( 'NAME<r><t><t>stargate-consul-example [<1s>] - I provide a RESTful API over HTTP<r>SYNOPSYS<r><t><t>stargate-consul-example --stargate.public-url=%<publicURL%> --stargate.port=%<port%> --stargate.operations-secret=%<operationsSecret%> --stargate.consul-agent-location=%<consulAgentLocation%> [--stargate.scheme=%<scheme%>]<r>PARAMETERS<r><t><t>--stargate.public-url=%<publicURL%><r><t><t><t>Public URL where the API is deployed. Used to create hypermedia links.<r><t><t>--stargate.port=%<port%><r><t><t><t>Listening port.<r><t><t>--stargate.operations-secret=%<operationsSecret%><r><t><t><t>Secret key for checking JWT signatures.<r><t><t>--stargate.consul-agent-location=%<consulAgentLocation%><r><t><t><t>Location of the Consul Agent. Leave empty to disable the plugin.<r><t><t>--stargate.scheme=%<scheme%><r><t><t><t>Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.<r>ENVIRONMENT<r><t><t>STARGATE__PUBLIC_URL<r><t><t><t>Public URL where the API is deployed. Used to create hypermedia links.<r><t><t>STARGATE__PORT<r><t><t><t>Listening port.<r><t><t>STARGATE__OPERATIONS_SECRET<r><t><t><t>Secret key for checking JWT signatures.<r><t><t>STARGATE__CONSUL_AGENT_LOCATION<r><t><t><t>Location of the Consul Agent. Leave empty to disable the plugin.<r><t><t>STARGATE__SCHEME<r><t><t><t>Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.<r>' expandMacrosWith: StargateConsulExample version )
self assert: help equals: ( 'NAME<r><t><t>stargate-consul-example [<1s>] - I provide a RESTful API over HTTP<r>SYNOPSYS<r><t><t>stargate-consul-example --stargate.public-url=%<publicURL%> --stargate.port=%<port%> --stargate.operations-secret=%<operationsSecret%> [--stargate.concurrent-connections-threshold=%<concurrentConnectionsThreshold%>] --stargate.consul-agent-location=%<consulAgentLocation%> [--stargate.scheme=%<scheme%>]<r>PARAMETERS<r><t><t>--stargate.public-url=%<publicURL%><r><t><t><t>Public URL where the API is deployed. Used to create hypermedia links.<r><t><t>--stargate.port=%<port%><r><t><t><t>Listening port.<r><t><t>--stargate.operations-secret=%<operationsSecret%><r><t><t><t>Secret key for checking JWT signatures.<r><t><t>--stargate.concurrent-connections-threshold=%<concurrentConnectionsThreshold%><r><t><t><t>Set the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed. Defaults to 32.<r><t><t>--stargate.consul-agent-location=%<consulAgentLocation%><r><t><t><t>Location of the Consul Agent. Leave empty to disable the plugin.<r><t><t>--stargate.scheme=%<scheme%><r><t><t><t>Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.<r>ENVIRONMENT<r><t><t>STARGATE__PUBLIC_URL<r><t><t><t>Public URL where the API is deployed. Used to create hypermedia links.<r><t><t>STARGATE__PORT<r><t><t><t>Listening port.<r><t><t>STARGATE__OPERATIONS_SECRET<r><t><t><t>Secret key for checking JWT signatures.<r><t><t>STARGATE__CONCURRENT_CONNECTIONS_THRESHOLD<r><t><t><t>Set the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed. Defaults to 32.<r><t><t>STARGATE__CONSUL_AGENT_LOCATION<r><t><t><t>Location of the Consul Agent. Leave empty to disable the plugin.<r><t><t>STARGATE__SCHEME<r><t><t><t>Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.<r>' expandMacrosWith: StargateConsulExample version )
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulExampleTest >> testProjectName [

self
assert: StargateConsulExample projectName
equals: 'Stargate-Consul'
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulExampleTest >> testStart [

| response |
Expand Down
2 changes: 1 addition & 1 deletion source/Stargate-Consul-Examples-Tests/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Stargate-Consul-Examples-Tests' }
Package { #name : 'Stargate-Consul-Examples-Tests' }

0 comments on commit 69eb178

Please sign in to comment.