### Question:
UserErrorMessageController { @DELETE @Produces(MediaType.APPLICATION_JSON) @Operation(tags = {"user-errors"}, summary = "Delete user errors for all users", description = "Will delete all user errors before specified timestamp", security = @SecurityRequirement(name = "admin_api_key"), responses = @ApiResponse(description = "Number of deleted entries", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UserErrorsDeleteResponse.class)))) @RolesAllowed("admin") public Response deleteByTimestamp(@Parameter(description = "Timestamp before which all user errors should be deleted ", required = true) @QueryParam("timestamp") long timestamp) { return Response.ok(new UserErrorsDeleteResponse(service.deleteByTimestamp(timestamp))).build(); } UserErrorMessageController(); @Inject  UserErrorMessageController(UserErrorMessageService service); @Path("/{address}") @GET @Produces(MediaType.APPLICATION_JSON) @Operation(tags = {"user-errors"}, summary = "Return last user errors for specified user", description = "Extract descending ordered user errors to specified db_id exclusive. Limit and user address are specified by parameters") Response getForUser(@Parameter(description = "db id to which user-errors should be extracted. By default is Long.MAX_VALUE") @QueryParam("toDbId") @DefaultValue("" + Long.MAX_VALUE) long toDbId,
                               @Parameter(description = "Number of entries to extract. By default is 100. Cannot be greater than 100.") @QueryParam("limit") @DefaultValue("100") int limit,
                               @Parameter(description = "User address", required = true) @PathParam("address") String address
    ); @GET @Produces(MediaType.APPLICATION_JSON) @Operation(tags = {"user-errors"}, summary = "Return last user errors for all users", description = "Extract descending ordered user errors until the specified db_id reached. Limit is specified by parameter", security = @SecurityRequirement(name = "admin_api_key"), responses = @ApiResponse(description = "User error message representation. Timestamp corresponds to UTC time.", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UserErrorMessage.class)))) @RolesAllowed("admin") Response getAll(@Parameter(description = "db id to which user-errors should be extracted. By default is Long.MAX_VALUE") @QueryParam("toDbId") @DefaultValue("" + Long.MAX_VALUE) long toDbId,
                           @Parameter(description = "Number of entries to extract. By default is 100.") @QueryParam("limit") @DefaultValue("100") int limit); @DELETE @Produces(MediaType.APPLICATION_JSON) @Operation(tags = {"user-errors"}, summary = "Delete user errors for all users", description = "Will delete all user errors before specified timestamp", security = @SecurityRequirement(name = "admin_api_key"), responses = @ApiResponse(description = "Number of deleted entries", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UserErrorsDeleteResponse.class)))) @RolesAllowed("admin") Response deleteByTimestamp(@Parameter(description = "Timestamp before which all user errors should be deleted ", required = true) @QueryParam("timestamp") long timestamp);  }### Answer:
@Test void testRemove() throws URISyntaxException, IOException { doReturn(1).when(service).deleteByTimestamp(101); MockHttpRequest request = MockHttpRequest.delete("/user-errors?timestamp=101").contentType(MediaType.APPLICATION_JSON_TYPE); MockHttpResponse response = new MockHttpResponse(); dispatcher.invoke(request, response); assertEquals(200, response.getStatus()); String errorJson = response.getContentAsString(); UserErrorMessageController.UserErrorsDeleteResponse value = mapper.readValue(errorJson, UserErrorMessageController.UserErrorsDeleteResponse.class); assertEquals(1, value.getDeleted()); }