Skip to content
Snippets Groups Projects
Unverified Commit b77a68e5 authored by Georgi Michev's avatar Georgi Michev
Browse files

refactor func names


Signed-off-by: default avatargeorgi.michev <georgi.michev@vereign.com>
parent 46f81427
No related branches found
No related tags found
1 merge request!22refactor step definitions
......@@ -189,4 +189,10 @@ public class RestGeneralStepDefinitions extends BaseStepDefinitions {
String cipherText = encrypt(message, pair.getPublic());
currentRequest.getHeaders().put("publicKey", cipherText);
}
@And("^I load value \\{(.*)\\} into current request HEADER \\{(.*)\\}$")
public void iLoadValueIntoCurrentRequestHEADER(String value, String headerName) throws Throwable {
currentRequest.getHeaders().put(headerName, value);
}
}
......@@ -6,7 +6,6 @@ import api.test.rest.RestSessionContainer;
import core.*;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import exceptions.RAFException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -21,26 +20,6 @@ public class CacheStepDefinitions extends BaseStepDefinitions {
this.currentRequest = currentRequest;
}
@Given("^I load the body of my Cache request with \\{(.*)\\} from \\{(.*)\\}$")
public void iLoadTheBodyOfMyPolicyRequestWithDataFromFile(String profileName, String jsonName) throws Throwable {
logger.info("Loading REST json into current request body. Json file= [{}] , profile= [{}]", jsonName, profileName);
String loadedProfileData = JsonUtils.getProfileFromJson("/REST/json/" + jsonName, profileName);
if (!loadedProfileData.equals("null")) {
currentRequest.setBody(loadedProfileData);
logger.info("SUCCESS - profile loaded.");
} else {
throw new RAFException(String.format("Profile loading FAILED. Value is \"null\". File= [%s] , profile= [%s]",
jsonName,
profileName)
, RestGeneralStepDefinitions.class);
}
}
@And("^I load value \\{(.*)\\} into current request HEADER \\{(.*)\\}$")
public void iLoadValueFromTheResponseIntoCurrentRequestHEADER(String value, String headerName) throws Throwable {
currentRequest.getHeaders().put(headerName, value);
}
@Given("we are testing the TSA Cache Api")
public void weAreTestingTheTSACacheApi() {
RestClient.setDefaultEncoding("UTF8");
......
......@@ -56,7 +56,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions {
}
@And("^I execute the Policy \\{(.*)\\} via TSA Policy API$")
public void iExecuteThePolicy(String path) throws Throwable {
public void iExecuteThePolicyTSAPolicyAPI(String path) throws Throwable {
currentRequest.setPath("/policy/example/" + path + "/1.0/evaluation");
Response response = RestClient.post(currentRequest);
addRequest(currentRequest);
......
......@@ -7,7 +7,6 @@ import com.jayway.jsonpath.JsonPath;
import core.*;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import exceptions.RAFException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -33,7 +32,7 @@ public class TaskStepDefinitions extends BaseStepDefinitions{
}
@And("^I execute the Task \\{(.*)\\} via TSA Task API$")
public void iExecuteTheTask(String path) throws Throwable {
public void iExecuteTheTaskTSATaskAPI(String path) throws Throwable {
currentRequest.setPath("/v1/task/" + path);
Response response = RestClient.post(currentRequest);
......
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