Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 10d47c14 authored by Yevhen Povietkin's avatar Yevhen Povietkin Committed by Jaime Pérez-Lozana
Browse files

SIMPL-3336 - identity attribute creation

parent 9fa18f05
No related branches found
No related tags found
No related merge requests found
Showing
with 372 additions and 220 deletions
package configuration.api.data;
public class Authority {
public static final String BASE_URL =
"https://security-attributes-provider.governance-authority.simpl.eu";
private Authority() {
throw new UnsupportedOperationException(
"Authority is a utility class and cannot be instantiated");
}
}
package configuration.api.data;
public final class Catalogue {
public static final String BASE_URL =
"https://fc-server.dev.simpl-europe.eu";
public static final String ENDPOINT_QUERY = "/query";
public static final String PARAMETERS_QUERY =
"?queryLanguage=OPENCYPHER&timeout=5&withTotalCount=true";
public static final String CREATE_QUERY_REQUEST_PATH =
"src/main/java/configuration/api/requests/Catalogue/createQuery.json";
public static final String QUERY_BY_TITLE_REQUEST_PATH =
"src/main/java/configuration/api/responses/Catalogue/queryByTitle.json";
private Catalogue() {
throw new UnsupportedOperationException(
"Catalogue is a utility class and cannot be instantiated");
}
}
package configuration.api.data;
public final class Common {
public static final String MEDIA_TYPE_JSON = "application/json";
public static final String MEDIA_TYPE_TEXT = "text/plain";
// Private constructor to prevent instantiation
private Common() {
throw new UnsupportedOperationException(
"Common is a utility class and cannot be instantiated");
}
}
package configuration.api.data;
public final class Users {
public static final String BASE_URL = "https://reqres.in";
public static final String ENDPOINT_USERS = "/api/Users";
public static final String ENDPOINT_USER_JANET = "/api/Users/2";
public static final String ENDPOINT_USER_MORPHEUS = "/api/Users/2";
public static final String CREATE_USER_REQUEST_PATH =
"src/main/java/configuration/api/requests/createUser.json";
public static final String UPDATE_MORPHEUS_INFO_REQUEST_PATH =
"src/main/java/configuration/api/requests/updateMorpheusInfo.json";
private Users() {
throw new UnsupportedOperationException(
"Users is a utility class and cannot be instantiated");
}
}
{
"statement": "MATCH (i)-[r:generalServiceProperties]-(m) WHERE i.title CONTAINS $title RETURN i",
"parameters": {
"title": "demoTestTitle"
}
}
{
"name": "john",
"job": "developer"
}
{
"name": "morpheus",
"job": "developer"
}
{
"totalCount": 1,
"items": [
{
"i": {
"identifier": "demoTestId",
"claimsGraphUri": [
"did:web:registry.gaia-x.eu:DataOffering:72jMxzPSTCyRN7cVtxYkkWAFkNneOjIKGz0L"
],
"description": "demoTestDescription",
"location": "demoTestLocation",
"title": "demoTestTitle"
}
}
]
}
......@@ -4,7 +4,6 @@ import com.microsoft.playwright.APIRequest;
import com.microsoft.playwright.APIRequestContext;
import com.microsoft.playwright.Playwright;
import io.cucumber.java.After;
import io.cucumber.java.Before;
import io.cucumber.java.Scenario;
public class ApiSetup {
......@@ -33,7 +32,7 @@ public class ApiSetup {
return scenario;
}
@After("@api")
@After(value = "@api", order = 1)
public void tearDown() {
if (apiContext != null) {
apiContext.dispose();
......
......@@ -7,36 +7,34 @@ import com.microsoft.playwright.APIResponse;
import com.microsoft.playwright.options.RequestOptions;
import framework.api.enums.HttpMethod;
import framework.api.enums.MediaType;
import framework.api.enums.Realm;
import framework.common.ScenarioLogger;
import io.cucumber.java.Scenario;
import org.apache.commons.lang3.StringUtils;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static configuration.api.data.Common.MEDIA_TYPE_JSON;
import static org.junit.Assert.assertTrue;
public class RequestHandler {
private final String baseUrl;
private final APIRequestContext apiContext;
private final Scenario scenario;
private final Map<String, String> headers = new HashMap<>();
private int statusCode;
private final ScenarioLogger logger;
private final List<Map<String, Object>> requestResponseLog;
public RequestHandler(String baseUrl, APIRequestContext apiContext, Scenario scenario) {
this.baseUrl = baseUrl;
this.apiContext = apiContext;
this.scenario = scenario;
this.logger = new ScenarioLogger(scenario);
headers.put("Content-Type", MEDIA_TYPE_JSON);
this.requestResponseLog = new ArrayList<>();
headers.put("Content-Type", MediaType.JSON.getValue());
}
public void addHeader(String key, String value) {
......@@ -47,81 +45,121 @@ public class RequestHandler {
headers.remove(key);
}
public String getAuthorizationToken(Realm realm, String username, String password) {
Map<String, String> bodyParams = Map.of(
"grant_type", "password",
"client_id", "frontend-cli",
"password", password,
"username", username
);
String endpoint = String.format("/auth/realms/%s/protocol/openid-connect/token", realm);
JsonObject response = this.sendUrlEncodedRequest(HttpMethod.POST, endpoint, bodyParams);
if (response != null && response.has("access_token")) {
return response.get("access_token").getAsString();
} else {
throw new RuntimeException("Access token not found in response");
}
}
public JsonObject sendRequest(HttpMethod method, String endpoint) {
String url = baseUrl + endpoint;
logger.logToScenario("Request URL", url);
return sendRequest(method, endpoint, null, true);
return sendRequest(method, endpoint, null, MediaType.JSON);
}
public JsonObject sendRequest(HttpMethod method, String endpoint, JsonObject bodyRequest) {
return sendRequest(method, endpoint, bodyRequest, MediaType.JSON);
}
public JsonObject sendUrlEncodedRequest(HttpMethod method, String endpoint, Map<String, String> data) {
String encodedData = encodeFormData(data);
return sendRequest(method, endpoint, encodedData, MediaType.X_WWW_FORM_URLENCODED);
}
public JsonObject sendRequest(HttpMethod method, String endpoint, JsonObject bodyRequest, boolean isHappyPath) {
private JsonObject sendRequest(HttpMethod method, String endpoint, Object body, MediaType mediaType) {
String url = baseUrl + endpoint;
logger.logToScenario("Request URL", url);
RequestOptions requestOptions = prepareRequestOptions(body, mediaType);
APIResponse response = getApiResponse(method, endpoint, bodyRequest);
APIResponse response = executeRequest(method, url, requestOptions);
String responseBody = response.text();
JsonObject jsonResponse = JsonParser.parseString(responseBody).getAsJsonObject();
statusCode = response.status();
logger.logToScenario("Response Status", String.valueOf(response.status()));
logger.logToScenario("Response Body", response.text());
JsonObject jsonResponse = null;
if (isHappyPath) {
assertTrue("The request was unsuccessful", response.ok());
if (responseBody != null && !responseBody.isEmpty()) {
jsonResponse = JsonParser.parseString(responseBody).getAsJsonObject();
}
Map<String, Object> logEntry = new HashMap<>();
logEntry.put("method", method);
logEntry.put("endpoint", endpoint);
logEntry.put("requestBody", body);
logEntry.put("responseBody", jsonResponse);
logEntry.put("statusCode", response.status());
requestResponseLog.add(logEntry);
return jsonResponse;
}
private APIResponse getApiResponse(HttpMethod method, String endpoint, JsonObject bodyRequest) {
private RequestOptions prepareRequestOptions(Object body, MediaType mediaType) {
RequestOptions requestOptions = RequestOptions.create();
headers.forEach(requestOptions::setHeader);
if (method.isRequestBodyRequired() && bodyRequest != null) {
logger.logToScenario("Request Body:", bodyRequest.toString());
requestOptions.setData(bodyRequest);
requestOptions.setHeader("Content-Type", mediaType.getValue());
if (body != null) {
if (body instanceof String) {
requestOptions.setData((String) body);
} else if (body instanceof JsonObject) {
requestOptions.setData((JsonObject) body);
}
}
return this.executeRequest(method, endpoint, requestOptions);
return requestOptions;
}
/**
* Sends an HTTP request and returns the raw APIResponse.
*
* @param method HTTP method (GET, POST, PUT, DELETE)
* @param endpoint API endpoint
* @param data Data to be sent in the request (can be null)
* @return APIResponse Raw API response
*/
public JsonObject sendUrlEncodedRequest(HttpMethod method, String endpoint, Map<String, String> data) {
String url = baseUrl + endpoint;
logger.logToScenario("Request URL", url);
private String encodeFormData(Map<String, String> data) {
return data.entrySet().stream()
.map(entry -> URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8) + "=" +
URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8))
.collect(Collectors.joining("&"));
}
RequestOptions optionsBuilder = RequestOptions.create();
optionsBuilder.setHeader("Content-Type", MediaType.X_WWW_FORM_URLENCODED.getValue());
public List<Map<String, Object>> getRequestResponseLog() {
return requestResponseLog;
}
List<String> encodedParams = data.entrySet().stream()
.map(entry -> {
return "password".equals(entry.getKey())
? entry.getKey() + "=" + entry.getValue()
: URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8) + "="
+ URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8);
})
.collect(Collectors.toList());
public Map<String, Object> getLastRequestResponse() {
if (requestResponseLog.isEmpty()) {
throw new IllegalStateException("No requests have been logged yet.");
}
return requestResponseLog.get(requestResponseLog.size() - 1);
}
String encodedData = StringUtils.join(encodedParams, "&");
optionsBuilder.setData(encodedData);
public JsonObject getLastRequestBody() {
if (requestResponseLog.isEmpty()) {
throw new IllegalStateException("No requests have been logged yet.");
}
APIResponse response = executeRequest(method, url, optionsBuilder);
statusCode = response.status();
logger.logToScenario("Response Status", String.valueOf(statusCode));
logger.logToScenario("Response Body", response.text());
Map<String, Object> lastLog = requestResponseLog.get(requestResponseLog.size() - 1);
return JsonParser.parseString(lastLog.get("requestBody").toString()).getAsJsonObject();
}
String responseBody = response.text();
return JsonParser.parseString(responseBody).getAsJsonObject();
public JsonObject getLastResponseBody() {
if (requestResponseLog.isEmpty()) {
throw new IllegalStateException("No requests have been logged yet.");
}
return (JsonObject) requestResponseLog.get(requestResponseLog.size() - 1).get("responseBody");
}
public int getLastStatusCode() {
if (requestResponseLog.isEmpty()) {
throw new IllegalStateException("No requests have been logged yet.");
}
return (int) requestResponseLog.get(requestResponseLog.size() - 1).get("statusCode");
}
private APIResponse executeRequest(HttpMethod method, String endpoint, RequestOptions requestOptions) {
logger.logToScenario("Request URL", endpoint);
APIResponse response = switch (method) {
case POST -> apiContext.post(endpoint, requestOptions);
case GET -> apiContext.get(endpoint, requestOptions);
......@@ -129,6 +167,8 @@ public class RequestHandler {
case DELETE -> apiContext.delete(endpoint, requestOptions);
default -> throw new IllegalArgumentException("Unsupported HTTP method: " + method);
};
statusCode = response.status();
logger.logToScenario("Response Status", String.valueOf(response.status()));
logger.logToScenario("Response Body", response.text());
return response;
......
package framework.api.enums;
import java.util.HashMap;
import java.util.Map;
public enum ApiEndpoint {
IDENTITY_ATTRIBUTE("/sap-api/identity-attribute", "Identity Attribute"),
PARTICIPANT_TYPE("/identity-api/participant", "Participant");
private final String path;
private final String displayName;
private static final Map<String, ApiEndpoint> DISPLAY_NAME_MAP = new HashMap<>();
static {
for (ApiEndpoint endpoint : values()) {
DISPLAY_NAME_MAP.put(endpoint.displayName.toLowerCase(), endpoint);
}
}
ApiEndpoint(String path, String displayName) {
this.path = path;
this.displayName = displayName;
}
public String getPath() {
return path;
}
public String getDisplayName() {
return displayName;
}
@Override
public String toString() {
return displayName;
}
public static ApiEndpoint fromString(String displayName) {
ApiEndpoint endpoint = DISPLAY_NAME_MAP.get(displayName.toLowerCase());
if (endpoint == null) {
throw new IllegalArgumentException("No endpoint found for display name: " + displayName);
}
return endpoint;
}
}
package framework.api.enums;
import framework.common.Config;
public final class BaseUrl {
public static final String AUTHORITY = Config.get("URL_AUTHORITY_API");
public static final String DATA_PROVIDER = Config.get("URL_DATA_PROVIDER_API");
public static final String CONSUMER = Config.get("URL_CONSUMER_API");
}
package framework.api.enums;
public enum HttpStatus {
OK(200, "OK"),
CREATED(201, "Created"),
DELETED(204, "Deleted"),
BAD_REQUEST(400, "Bad Request"),
NOT_FOUND(404, "Not Found");
private final int code;
private final String description;
HttpStatus(int code, String description) {
this.code = code;
this.description = description;
}
public int getCode() {
return code;
}
public String getDescription() {
return description;
}
}
package framework.api.enums;
public enum Username {
AUTHORITY_ROLE_IATTR_M_AUTO("authority_role_iattr_m_auto"),
AUTHORITY_ROLE_NOTARY_AUTO("authority_role_notary_auto"),
AUTHORITY_ROLE_T1UAR_M_AUTO("authority_role_t1uar_m_auto"),
AUTHORITY_ROLE_T2IAA_M_AUTO("authority_role_t2iaa_m_auto");
private final String username;
Username(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
@Override
public String toString() {
return username;
}
}
package framework.api.services.securityAttributesProvider;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import framework.common.Utils;
import java.util.List;
import java.util.Map;
public class IdentityAttributeRequestBuilder {
private final JsonObject requestBody;
public IdentityAttributeRequestBuilder() {
this.requestBody = new JsonObject();
}
public IdentityAttributeRequestBuilder fromMap(Map<String, String> data) {
String participantTypesRaw = data.getOrDefault("Participant Types", "");
List<String> participantTypes = List.of(participantTypesRaw.split(";\\s*"));
String code = Utils.resolveRandomizedValue(data.get("Code"));
String name = Utils.resolveRandomizedValue(data.get("Name"));
String description = Utils.resolveRandomizedValue(data.get("Description"));
withCode(code)
.withEnabled(Boolean.parseBoolean(data.getOrDefault("Enabled", "true")))
.withAssignableToRoles(Boolean.parseBoolean(data.getOrDefault("Assignable to roles", "true")))
.withName(name)
.withDescription(description)
.withParticipantTypes(participantTypes);
return this;
}
public IdentityAttributeRequestBuilder withCode(String code) {
requestBody.addProperty("code", code);
return this;
}
public IdentityAttributeRequestBuilder withEnabled(boolean enabled) {
requestBody.addProperty("enabled", enabled);
return this;
}
public IdentityAttributeRequestBuilder withAssignableToRoles(boolean assignableToRoles) {
requestBody.addProperty("assignableToRoles", assignableToRoles);
return this;
}
public IdentityAttributeRequestBuilder withName(String name) {
requestBody.addProperty("name", name);
return this;
}
public IdentityAttributeRequestBuilder withDescription(String description) {
requestBody.addProperty("description", description);
return this;
}
public void withParticipantTypes(List<String> participantTypes) {
JsonArray participantTypeArray = new JsonArray();
participantTypes.forEach(participantTypeArray::add);
requestBody.add("participantTypes", participantTypeArray);
}
public JsonObject build() {
return requestBody;
}
}
package framework.common;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import io.cucumber.java.Scenario;
import java.util.Random;
import static configuration.api.data.Common.MEDIA_TYPE_JSON;
import static configuration.api.data.Common.MEDIA_TYPE_TEXT;
public final class Utils {
......@@ -17,14 +12,24 @@ public final class Utils {
this.scenario = scenario;
}
public void printJson(String json, String title) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
JsonElement jsonElement = JsonParser.parseString(json);
String prettyJson = gson.toJson(jsonElement);
scenario.attach(prettyJson, MEDIA_TYPE_JSON, title);
public static String generateRandomString() {
final int letterA = 97;
final int letterZ = 122;
int targetStringLength = 10;
Random random = new Random();
return random.ints(letterA, letterZ + 1)
.limit(targetStringLength)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
.toString();
}
public void printText(String text, String name) {
scenario.attach(text, MEDIA_TYPE_TEXT, name);
public static String resolveRandomizedValue(String value) {
if (value != null && value.startsWith("RANDOM_")) {
return Utils.generateRandomString();
}
return value;
}
}
@Authority @regression @api
@AuthorityAPI @regression @api
Feature: Authority
Scenario: Successful authorization
Given the Gateway is configured
When the response status code is 200
Then the response contains the following fields
| access_token |
@SIMPL-3336 @SIMPL-3337
Scenario: User with IATTR_M Role Creates a New Identity Attribute
Given the user with the IATTR_M role is logged in via Keycloak
When the user creates and assigns "Identity attribute" with the following data:
| Code | RANDOM_CODE |
| Enabled | true |
| Assignable to roles | true |
| Name | RANDOM_NAME |
| Description | RANDOM_DESCRIPTION |
| Participant Types | DATA_PROVIDER; CONSUMER |
Then the identity attribute is successfully created
And the response body contains created Identity Attribute's details
And the response body contains assigned Participant Types
| DATA_PROVIDER |
| CONSUMER |
package stepDefinitions.api.simplOpen;
import framework.api.services.securityAttributesProvider.IdentityAttributeRequestBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.microsoft.playwright.APIResponse;
import framework.api.ApiSetup;
import framework.api.RequestHandler;
import framework.api.enums.Realm;
import framework.common.Config;
import framework.api.enums.*;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.After;
import io.cucumber.java.Before;
import io.cucumber.java.Scenario;
import framework.api.enums.HttpMethod;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
......@@ -18,58 +17,78 @@ import io.cucumber.java.en.When;
import java.util.List;
import java.util.Map;
import static configuration.api.data.Authority.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class AuthoritySteps {
private static ApiSetup setup;
private static JsonObject jsonResponse;
private RequestHandler requestHandler;
private final String gatewayUrl = Config.get("URL_KEYCLOAK_AUTHORITY");
private final Realm realm = Realm.AUTHORITY;
private Scenario scenario;
private String clientId;
private String username;
private String password;
@Before("@api")
private ApiEndpoint identityAttributeEndpoint;
@Before("@AuthorityAPI")
public void setUp(Scenario scenario) {
this.scenario = scenario;
setup = new ApiSetup();
setup.setUp(gatewayUrl, scenario);
requestHandler = new RequestHandler(gatewayUrl, setup.getApiContext(), scenario);
ApiSetup setup = new ApiSetup();
setup.setUp(BaseUrl.AUTHORITY, scenario);
requestHandler = new RequestHandler(BaseUrl.AUTHORITY, setup.getApiContext(), scenario);
}
@Given("the user with the IATTR_M role is logged in via Keycloak")
public void theUserWithTheIattrMRoleIsLoggedInViaKeycloak() {
String token = requestHandler.getAuthorizationToken(Realm.AUTHORITY, Username.AUTHORITY_ROLE_IATTR_M_AUTO.getUsername(), "password");
requestHandler.addHeader("Authorization", "Bearer " + token);
}
private JsonObject sendAuthorizationRequest() {
Map<String, String> bodyParams = Map.of(
"grant_type", "password",
"client_id", "frontend-cli",
"password", "password",
"username", "authority_role_iattr_m_api"
);
@When("the user creates and assigns {string} with the following data:")
public void theUserSendsAPostRequestWithAListOfParticipantTypes(String endpointName, DataTable dataTable) {
identityAttributeEndpoint = ApiEndpoint.fromString(endpointName);
String endpoint = String.format("/realms/%s/protocol/openid-connect/token", realm);
Map<String, String> data = dataTable.asMap(String.class, String.class);
return requestHandler.sendUrlEncodedRequest(HttpMethod.POST, endpoint, bodyParams);
JsonObject requestBody = new IdentityAttributeRequestBuilder()
.fromMap(data)
.build();
requestHandler.sendRequest(HttpMethod.POST, identityAttributeEndpoint.getPath(), requestBody);
}
@Given("the Gateway is configured")
public void theGatewayIsConfigured() {
jsonResponse = sendAuthorizationRequest();
@Then("the response body contains created Identity Attribute's details")
public void theResponseBodyContainsIdentityAttributeDetails() {
JsonObject requestBody = requestHandler.getLastRequestBody();
JsonObject responseBody = requestHandler.getLastResponseBody();
String expectedCode = requestBody.get("code").getAsString();
String expectedName = requestBody.get("name").getAsString();
String expectedDescription = requestBody.get("description").getAsString();
assertTrue("Response does not contain 'code'", responseBody.has("code"));
assertEquals("Mismatch in 'code'", expectedCode, responseBody.get("code").getAsString());
assertTrue("Response does not contain 'name'", responseBody.has("name"));
assertEquals("Mismatch in 'name'", expectedName, responseBody.get("name").getAsString());
assertTrue("Response does not contain 'description'", responseBody.has("description"));
assertEquals("Mismatch in 'description'", expectedDescription, responseBody.get("description").getAsString());
}
@When("the user sends a {word} request to {string}")
public void sendRequest(String method, String endpoint) {
HttpMethod httpMethod;
try {
httpMethod = HttpMethod.valueOf(method.toUpperCase());
} catch (IllegalArgumentException e) {
throw new RuntimeException("Invalid HTTP method: " + method);
@Then("the response body contains assigned Participant Types")
public void theResponseBodyContainsAssignedParticipantTypes(DataTable dataTable) {
List<String> expectedParticipantTypes = dataTable.asList(String.class);
JsonObject responseBody = requestHandler.getLastResponseBody();
JsonArray actualParticipantTypes = responseBody.getAsJsonArray("participantTypes");
for (String expectedType : expectedParticipantTypes) {
assertTrue("Participant type not found in response: " + expectedType,
actualParticipantTypes.toString().contains(expectedType));
}
}
@Then("the identity attribute is successfully created")
public void validateSuccessfulCreation() {
int actualStatusCode = requestHandler.getLastStatusCode();
int expectedStatusCode = HttpStatus.CREATED.getCode();
jsonResponse = requestHandler.sendRequest(httpMethod, endpoint);
assertEquals("Mismatch in status code", expectedStatusCode, actualStatusCode);
}
@Then("the response status code is {int}")
......@@ -78,24 +97,19 @@ public class AuthoritySteps {
assertEquals(expectedStatusCode, actualStatusCode);
}
@Then("the response contains the following fields")
public void validateResponseFields(DataTable dataTable) {
Map<String, String> expectedFields = dataTable.asMap(String.class, String.class);
@After(value = "@SIMPL-3336", order = 2)
public void deleteIdentityAttribute() {
String identityAttributeId = requestHandler.getLastResponseBody()
.get("id")
.getAsString();
for (Map.Entry<String, String> entry : expectedFields.entrySet()) {
String key = entry.getKey();
String expectedValue = entry.getValue();
String actualValue = jsonResponse.get(key).getAsString();
assertEquals("Value mismatch for key: " + key, expectedValue, actualValue);
}
}
String deleteEndpoint = identityAttributeEndpoint.getPath() + '/' + identityAttributeId;
@Then("the response should contain the following keys")
public void validateResponseKeys(DataTable dataTable) {
List<String> expectedKeys = dataTable.asList(String.class);
requestHandler.sendRequest(HttpMethod.DELETE, deleteEndpoint);
for (String key : expectedKeys) {
assertTrue("Response does not contain the key: " + key, jsonResponse.has(key));
}
int actualStatusCode = requestHandler.getStatusCode();
int expectedStatusCode = HttpStatus.DELETED.getCode();
assertEquals(expectedStatusCode, actualStatusCode);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment