Skip to content

Commit

Permalink
Jira Service Test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Nov 1, 2024
1 parent e3843d5 commit 8386377
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ private static Stream<Arguments> provideHttpStatusCodesWithExceptionClass() {
return Stream.of(
Arguments.of(HttpStatus.valueOf(AUTHORIZATION_ERROR_CODE), UnAuthorizedException.class),
Arguments.of(HttpStatus.valueOf(TOKEN_EXPIRED), RuntimeException.class),
Arguments.of(HttpStatus.TOO_MANY_REQUESTS, RuntimeException.class)
Arguments.of(HttpStatus.TOO_MANY_REQUESTS, RuntimeException.class),
Arguments.of(HttpStatus.INSUFFICIENT_STORAGE, RuntimeException.class)
);
}

Expand Down Expand Up @@ -264,7 +265,7 @@ void testInvokeRestApiTokenExpiredInterruptException() throws JsonProcessingExce
JiraSourceConfig jiraSourceConfig = createJiraConfiguration(BASIC, issueType, issueStatus, projectKey);
JiraService jiraService = new JiraService(restTemplate, jiraSourceConfig, authConfig);
when(authConfig.getUrl()).thenReturn("https://example.com/rest/api/2/issue/key");
doReturn(new ResponseEntity<>("", HttpStatus.UNAUTHORIZED)).when(restTemplate).getForEntity(any(URI.class), any(Class.class));
when(restTemplate.getForEntity(any(URI.class), any(Class.class))).thenThrow(new HttpClientErrorException(HttpStatus.TOO_MANY_REQUESTS));
jiraService.setSleepTimeMultiplier(100000);

Thread testThread = new Thread(() -> {
Expand Down

0 comments on commit 8386377

Please sign in to comment.