Skip to content

Commit

Permalink
[FIX]: various improvements and fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Drednote committed Dec 4, 2024
1 parent ccf0589 commit eb0dbd4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ void shouldSaveAndRemoveContext() throws Throwable {
UpdateRequestContext.class)) {
TelegramResponse response = Mockito.mock(TelegramResponse.class);
when(response.isExecutePostFilters()).thenReturn(true);
doThrow(new Exception()).when(updateHandler).onUpdate(any());
doThrow(new IllegalStateException()).when(updateHandler).onUpdate(any());
doThrow(new RuntimeException()).when(response).process(any());
doAnswer(invocation -> {
UpdateRequest request = invocation.getArgument(0, UpdateRequest.class);
request.getAccessor().setResponse(response);
if (request.getError() instanceof IllegalStateException) {
request.getAccessor().setResponse(response);
}
return request;
}).when(exceptionHandler).handle(any());

Expand Down

0 comments on commit eb0dbd4

Please sign in to comment.