Skip to content

Commit

Permalink
fix TargetRecordingPatchHandlerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 11, 2022
1 parent dfe11a3 commit 73664fb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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)))
Expand Down

0 comments on commit 73664fb

Please sign in to comment.