Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test to check caching directives are kept in Not Modified res… #179

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
I'm the test case for the Application Configuration API
"
Class {
#name : #ApplicationConfigurationPluginAPITest,
#superclass : #OperationalPluginAPITest,
#category : #'Stargate-Application-Configuration-Tests'
#name : 'ApplicationConfigurationPluginAPITest',
#superclass : 'OperationalPluginAPITest',
#category : 'Stargate-Application-Configuration-Tests',
#package : 'Stargate-Application-Configuration-Tests'
}

{ #category : #private }
{ #category : 'private' }
ApplicationConfigurationPluginAPITest >> configurationParameters [

^ Array with: ( MandatoryConfigurationParameter named: 'Public URL' describedBy: 'Public URL' )
]

{ #category : #private }
{ #category : 'private' }
ApplicationConfigurationPluginAPITest >> configurationProvider [

^ [
Expand All @@ -23,7 +24,7 @@ ApplicationConfigurationPluginAPITest >> configurationProvider [
]
]

{ #category : #running }
{ #category : 'running' }
ApplicationConfigurationPluginAPITest >> operationsConfiguration [

^ super operationsConfiguration
Expand All @@ -36,13 +37,13 @@ ApplicationConfigurationPluginAPITest >> operationsConfiguration [
yourself
]

{ #category : #private }
{ #category : 'private' }
ApplicationConfigurationPluginAPITest >> requiredPermissions [

^ #('read:application-configuration')
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginAPITest >> testDisablePlugin [

self assertIsEnabled: ApplicationConfigurationPlugin.
Expand All @@ -62,7 +63,7 @@ ApplicationConfigurationPluginAPITest >> testDisablePlugin [
withExceptionDo: [ :error | self assert: error response isNotFound ]
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginAPITest >> testEnablePreviouslyDisabledPlugin [

self assertIsEnabled: ApplicationConfigurationPlugin.
Expand All @@ -76,7 +77,7 @@ ApplicationConfigurationPluginAPITest >> testEnablePreviouslyDisabledPlugin [
self testGetConfigurationWithPermissions
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginAPITest >> testGetConfigurationWithPermissions [

| response |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
I'm a test for API configuration options
"
Class {
#name : #ApplicationConfigurationPluginConfigurationAPITest,
#superclass : #OperationalPluginAPITest,
#category : #'Stargate-Application-Configuration-Tests'
#name : 'ApplicationConfigurationPluginConfigurationAPITest',
#superclass : 'OperationalPluginAPITest',
#category : 'Stargate-Application-Configuration-Tests',
#package : 'Stargate-Application-Configuration-Tests'
}

{ #category : #running }
{ #category : 'running' }
ApplicationConfigurationPluginConfigurationAPITest >> operationsConfiguration [

^ super operationsConfiguration
at: ApplicationConfigurationPlugin endpoint put: { #enabled -> false } asDictionary;
yourself
]

{ #category : #private }
{ #category : 'private' }
ApplicationConfigurationPluginConfigurationAPITest >> requiredPermissions [

^ #('read:application-configuration')
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginConfigurationAPITest >> testPluginIsDisabled [

self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
An ApplicationConfigurationPluginTest is a test class for testing the behavior of ApplicationConfigurationPlugin
"
Class {
#name : #ApplicationConfigurationPluginTest,
#superclass : #TestCase,
#category : #'Stargate-Application-Configuration-Tests'
#name : 'ApplicationConfigurationPluginTest',
#superclass : 'TestCase',
#category : 'Stargate-Application-Configuration-Tests',
#package : 'Stargate-Application-Configuration-Tests'
}

{ #category : #accessing }
{ #category : 'accessing' }
ApplicationConfigurationPluginTest >> configuration [

^ Dictionary new
Expand All @@ -20,7 +21,7 @@ ApplicationConfigurationPluginTest >> configuration [
yourself
]

{ #category : #accessing }
{ #category : 'accessing' }
ApplicationConfigurationPluginTest >> configurationParameters [

^ Array
Expand All @@ -35,7 +36,7 @@ ApplicationConfigurationPluginTest >> configurationParameters [
convertingWith: [ :value | value = 'true' ] )
]

{ #category : #accessing }
{ #category : 'accessing' }
ApplicationConfigurationPluginTest >> configurationProvider [

^ [
Expand All @@ -46,7 +47,7 @@ ApplicationConfigurationPluginTest >> configurationProvider [
]
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginTest >> testConfigurationAccessing [

| plugin parameter |
Expand Down Expand Up @@ -74,19 +75,19 @@ ApplicationConfigurationPluginTest >> testConfigurationAccessing [
assert: ( plugin currentValueFor: parameter )
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginTest >> testEnabledByDefault [

self deny: ApplicationConfigurationPlugin enabledByDefault
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginTest >> testEndpoint [

self assert: ApplicationConfigurationPlugin endpoint equals: 'application-configuration'
]

{ #category : #tests }
{ #category : 'tests' }
ApplicationConfigurationPluginTest >> testPluginName [

self assert: ApplicationConfigurationPlugin pluginName equals: 'Application Configuration'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
An ApplicationConfigurationRESTfulControllerTest is a test class for testing the behavior of ApplicationConfigurationRESTfulController
"
Class {
#name : #ApplicationConfigurationRESTfulControllerTest,
#superclass : #OperationalPluginRESTfulControllerTest,
#category : #'Stargate-Application-Configuration-Tests'
#name : 'ApplicationConfigurationRESTfulControllerTest',
#superclass : 'OperationalPluginRESTfulControllerTest',
#category : 'Stargate-Application-Configuration-Tests',
#package : 'Stargate-Application-Configuration-Tests'
}

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> configurationParameters [

^ Array
Expand All @@ -25,7 +26,7 @@ ApplicationConfigurationRESTfulControllerTest >> configurationParameters [
asSensitive
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> configurationProvider [

^ [
Expand All @@ -36,7 +37,7 @@ ApplicationConfigurationRESTfulControllerTest >> configurationProvider [
]
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> operationsConfiguration [

^ super operationsConfiguration
Expand All @@ -49,15 +50,15 @@ ApplicationConfigurationRESTfulControllerTest >> operationsConfiguration [
yourself
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> setUpResourceController [

resourceController := ApplicationConfigurationRESTfulController
over: ( ApplicationConfigurationPlugin configuredBy: self operationsConfiguration )
configuredBy: self operationsConfiguration
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> testGetConfigurationInJson [

| response |
Expand Down Expand Up @@ -112,13 +113,13 @@ ApplicationConfigurationRESTfulControllerTest >> testGetConfigurationInJson [
assert: config attributeName equals: 'secret';
assert: config commandLineArgumentName equals: 'vault.secret';
assert: config environmentVariableName equals: 'VAULT__SECRET';
assert: config sections equals: #( 'Vault' );
assert: config sections hasTheSameElementsInTheSameOrderThat: #( 'Vault' );
assert: ( config at: #'current-value' ) equals: '**********'
]
]
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> testGetConfigurationInPlainText [

| response |
Expand All @@ -137,7 +138,7 @@ ApplicationConfigurationRESTfulControllerTest >> testGetConfigurationInPlainText
with: String lf )
]

{ #category : #'private - support' }
{ #category : 'private - support' }
ApplicationConfigurationRESTfulControllerTest >> withConfigurationNamed: aName in: configurations do: aBlock [

configurations detect: [ :config | config name = aName ] ifFound: aBlock ifNone: [ self fail ]
Expand Down
2 changes: 1 addition & 1 deletion source/Stargate-Application-Configuration-Tests/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Stargate-Application-Configuration-Tests' }
Package { #name : 'Stargate-Application-Configuration-Tests' }
Loading