Skip to content

Commit

Permalink
Remove Update action authentication rest api related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashanthamara committed Nov 28, 2024
1 parent 91d2c02 commit 388dcac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,43 +204,6 @@ public void testUpdateActionWithInvalidID() {
}

@Test(dependsOnMethods = {"testUpdateActionWithInvalidID"})
public void testUpdateActionWithInvalidEndpointAuthProperties() {

AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_USERNAME_INVALID_AUTH_PROPERTY, TEST_USERNAME_AUTH_PROPERTY_VALUE);
put(TEST_PASSWORD_AUTH_PROPERTY, TEST_PASSWORD_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId2 + ACTION_BASIC_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_BAD_REQUEST)
.body("description", equalTo("Required authentication properties are not " +
"provided or invalid."));
}

@Test(dependsOnMethods = {"testUpdateActionWithInvalidEndpointAuthProperties"})
public void testUpdateActionWithEmptyEndpointAuthPropertyValues() {

AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_USERNAME_AUTH_PROPERTY, "");
put(TEST_PASSWORD_AUTH_PROPERTY, TEST_PASSWORD_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId2 + ACTION_BASIC_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_BAD_REQUEST)
.body("description", equalTo("Authentication property values cannot be empty."));
}

@Test(dependsOnMethods = {"testUpdateActionWithEmptyEndpointAuthPropertyValues"})
public void testActivateActionWithInvalidID() {

getResponseOfPost(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,45 +324,6 @@ public void testUpdateAction() {
}

@Test(dependsOnMethods = {"testUpdateAction"})
public void testUpdateEndpointAuthentication() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.uri", equalTo(TEST_ENDPOINT_URI))
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));
}

@Test(dependsOnMethods = {"testUpdateEndpointAuthentication"})
public void testUpdateEndpointAuthProperties() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_UPDATED_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));
}

@Test(dependsOnMethods = {"testUpdateEndpointAuthProperties"})
public void testDeactivateAction() {

getResponseOfPost(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
Expand Down

0 comments on commit 388dcac

Please sign in to comment.