Skip to content

Commit

Permalink
Add getWarningsAndErrors() to API
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Dirkse committed May 3, 2024
1 parent 4a81e33 commit 1a2d2b9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/nl/nn/testtool/web/api/ReportApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import nl.nn.testtool.storage.LogStorage;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
Expand Down Expand Up @@ -617,4 +618,21 @@ public Report getReport(Storage storage, Integer storageId) throws StorageExcept
if (report != null) report.setTestTool(testTool);
return report;
}

@GET
@Path("warningsAndErrors/{storage}")
@Produces(MediaType.TEXT_PLAIN)
public Response getWarningsAndErrors(
@PathParam("storage") String storageName
) {
Storage rawStorage = testTool.getStorage(storageName);
if (! (rawStorage instanceof LogStorage)) {
return null;
}
LogStorage storage = (LogStorage) rawStorage;
return Response
.status(Response.Status.OK)
.entity(storage.getWarningsAndErrors())
.build();
}
}

0 comments on commit 1a2d2b9

Please sign in to comment.