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

Remove Update action authentication rest api related tests #21839

Merged
merged 1 commit into from
Nov 28, 2024
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 @@ -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