Skip to content
Closed
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
6 changes: 5 additions & 1 deletion src/test/java/com/datadog/api/Undo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public static class Parameter {
public List<Parameter> parameters;

public Map<String, Object> getRequestParameters(
Object responseData, Object requestData, Method requestBuilder, ObjectMapper mapper, Map<String, Object> pathParameters) {
Object responseData,
Object requestData,
Method requestBuilder,
ObjectMapper mapper,
Map<String, Object> pathParameters) {
Map<String, Object> requestParams = new HashMap<String, Object>();
for (int i = 0; i < parameters.size(); i++) {
Undo.UndoMethod.Parameter p = parameters.get(i);
Expand Down
16 changes: 12 additions & 4 deletions src/test/java/com/datadog/api/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void newRequest(String name) {
}
}
parametersArray = new ArrayList<>();
pathParameters = new HashMap<>(); // Clear path parameters for new request
pathParameters = new HashMap<>(); // Clear path parameters for new request
}

public void addRequestParameter(String parameterName, String value)
Expand Down Expand Up @@ -458,7 +458,9 @@ public void given(String apiVersion, Given step) throws Exception {

Undo undoSettings = UndoAction.UndoAction().getUndo(apiVersion, step.getOperationName());
if (undoSettings != null) {
undo.add(getRequestUndo(apiVersion, undoSettings, responseData, givenParametersArray.get(0), pathParameters));
undo.add(
getRequestUndo(
apiVersion, undoSettings, responseData, givenParametersArray.get(0), pathParameters));
}

if (step.source != null) {
Expand All @@ -471,7 +473,11 @@ public void given(String apiVersion, Given step) throws Exception {
}

public Callable<?> getRequestUndo(
String apiVersion, Undo undoSettings, Object responseData, Object requestData, Map<String, Object> pathParameters)
String apiVersion,
Undo undoSettings,
Object responseData,
Object requestData,
Map<String, Object> pathParameters)
throws Exception {
// find API service based on undo tag value
Class<?> undoAPIClass =
Expand Down Expand Up @@ -579,7 +585,9 @@ public void sendRequest() throws Exception {
} catch (Exception e) {
throw new Exception(e.getCause());
}
undo.add(getRequestUndo(apiVersion, undoSettings, responseData, parametersArray.get(0), pathParameters));
undo.add(
getRequestUndo(
apiVersion, undoSettings, responseData, parametersArray.get(0), pathParameters));
}
}

Expand Down