Skip to content

Commit

Permalink
feat: report level stub strategy can be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsSmets committed Aug 27, 2024
1 parent e24d746 commit 5961525
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/nl/nn/testtool/web/api/ReportApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public Response getLatestReports(@PathParam("storage") String storageName, @Path
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateReport(@PathParam("storage") String storageName, @PathParam("storageId") int storageId, Map<String, String> map) {
String[] fields = new String[]{"name", "path", "variables", "description", "transformation", "checkpointId", "checkpointMessage", "stub"};
String[] fields = new String[]{"name", "path", "variables", "description", "transformation", "checkpointId", "checkpointMessage", "stub", "stubStrategy"};
if (map.isEmpty() || !mapContainsOnly(map, null, fields))
return Response.status(Response.Status.BAD_REQUEST).entity("No new values or incorrect values have been given for report with storageId [" + storageId + "] - detailed error message - Values given are:\n" + map).build();

Expand All @@ -315,6 +315,9 @@ public Response updateReport(@PathParam("storage") String storageName, @PathPara
if (StringUtils.isNotEmpty(map.get("transformation")))
report.setTransformation(map.get("transformation"));

if (StringUtils.isNotEmpty(map.get("stubStrategy")))
report.setStubStrategy(map.get("stubStrategy"));

String variables = map.get("variables");
if (variables != null && !variables.equals(report.getVariableCsv())) {
report.setVariableCsv(variables);
Expand Down

0 comments on commit 5961525

Please sign in to comment.