diff --git a/src/test/java/io/cryostat/JsonRequestFilterTest.java b/src/test/java/io/cryostat/JsonRequestFilterTest.java index d2668cde0..0540104a0 100644 --- a/src/test/java/io/cryostat/JsonRequestFilterTest.java +++ b/src/test/java/io/cryostat/JsonRequestFilterTest.java @@ -25,9 +25,11 @@ import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mockito; public class JsonRequestFilterTest { private JsonRequestFilter filter; @@ -76,6 +78,9 @@ private void simulateRequest(String jsonPayload) throws Exception { new ByteArrayInputStream(jsonPayload.getBytes(StandardCharsets.UTF_8)); when(requestContext.getEntityStream()).thenReturn(payloadStream); when(requestContext.getMediaType()).thenReturn(MediaType.APPLICATION_JSON_TYPE); + UriInfo uriInfo = Mockito.mock(UriInfo.class); + when(uriInfo.getPath()).thenReturn("/api/v3/rules"); + when(requestContext.getUriInfo()).thenReturn(uriInfo); filter.filter(requestContext); } }