-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #314 from galasa-dev/ash-cps-property
CPS property name now accepts @ symbol
- Loading branch information
Showing
4 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,22 @@ func TestDeletePropertyValueReturnsOk(t *testing.T) { | |
assert.Nil(t, err) | ||
} | ||
|
||
func TestDeletePropertyValueWithAtSymbolReturnsOk(t *testing.T) { | ||
//Given... | ||
namespace := "validnamespace" | ||
name := "[email protected]" | ||
|
||
server := newDeletePropertiesServletMock(t) | ||
apiClient := api.InitialiseAPI(server.URL) | ||
defer server.Close() | ||
|
||
//When | ||
err := DeleteProperty(namespace, name, apiClient) | ||
|
||
//Then | ||
assert.Nil(t, err) | ||
} | ||
|
||
// invalid OR empty namespace, valid propertyname | ||
func TestDeletePropertyWithInvalidNamesapceFormatReturnsError(t *testing.T) { | ||
//Given... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,25 @@ func TestCreatePropertyWithValidNamespaceReturnsOk(t *testing.T) { | |
assert.Nil(t, err) | ||
} | ||
|
||
func TestCreatePropertyWithValidNamespaceWithAtSymbolReturnsOk(t *testing.T) { | ||
//Given... | ||
namespace := "validnamespace" | ||
name := "[email protected]" | ||
value := "someValue" | ||
|
||
server := newSetPropertiesServletMock(t) | ||
apiServerUrl := server.URL | ||
defer server.Close() | ||
|
||
apiClient := api.InitialiseAPI(apiServerUrl) | ||
|
||
//When | ||
err := SetProperty(namespace, name, value, apiClient) | ||
|
||
//Then | ||
assert.Nil(t, err) | ||
} | ||
|
||
func TestUpdatePropertyWithInvalidNamespaceAndInvalidPropertyNameReturnsError(t *testing.T) { | ||
//Given... | ||
namespace := "invalidnamespace" | ||
|
@@ -146,6 +165,25 @@ func TestUpdatePropertyWithValidNamespaceAndVaidNameValueReturnsOk(t *testing.T) | |
assert.Nil(t, err) | ||
} | ||
|
||
func TestUpdatePropertyWithValidNamespaceAndVaidNameValueWithAtSymbolReturnsOk(t *testing.T) { | ||
//Given... | ||
namespace := "validnamespace" | ||
name := "[email protected]" | ||
value := "updatedValue" | ||
|
||
server := newSetPropertiesServletMock(t) | ||
apiServerUrl := server.URL | ||
defer server.Close() | ||
|
||
apiClient := api.InitialiseAPI(apiServerUrl) | ||
|
||
//When | ||
err := SetProperty(namespace, name, value, apiClient) | ||
|
||
//Then | ||
assert.Nil(t, err) | ||
} | ||
|
||
func TestUpdatePropertyWithInvalidNamespaceAndValidNameReturnsError(t *testing.T) { | ||
//Given... | ||
namespace := "invalidnamespace" | ||
|