diff --git a/src/test/java/io/cryostat/net/web/http/api/v1/TargetRecordingPatchHandlerTest.java b/src/test/java/io/cryostat/net/web/http/api/v1/TargetRecordingPatchHandlerTest.java index 3987787e08..006b99ad40 100644 --- a/src/test/java/io/cryostat/net/web/http/api/v1/TargetRecordingPatchHandlerTest.java +++ b/src/test/java/io/cryostat/net/web/http/api/v1/TargetRecordingPatchHandlerTest.java @@ -122,6 +122,8 @@ void shouldNotBeAsync() { void shouldThrow401IfAuthFails() { Mockito.when(authManager.validateHttpHeader(Mockito.any(), Mockito.any(), Mockito.any())) .thenReturn(CompletableFuture.completedFuture(false)); + Mockito.when(ctx.request()).thenReturn(req); + Mockito.when(req.headers()).thenReturn(MultiMap.caseInsensitiveMultiMap()); HttpException ex = Assertions.assertThrows(HttpException.class, () -> handler.handle(ctx)); MatcherAssert.assertThat(ex.getStatusCode(), Matchers.equalTo(401)); @@ -135,6 +137,8 @@ void shouldThrow400InvalidOperations(String mtd) { .thenReturn(CompletableFuture.completedFuture(true)); Mockito.when(ctx.getBodyAsString()).thenReturn(mtd); Mockito.when(ctx.response()).thenReturn(resp); + Mockito.when(ctx.request()).thenReturn(req); + Mockito.when(req.headers()).thenReturn(MultiMap.caseInsensitiveMultiMap()); Mockito.when( resp.putHeader( Mockito.any(CharSequence.class), Mockito.any(CharSequence.class)))