diff --git a/src/test/kotlin/net/leanix/githubagent/services/GitHubAuthenticationServiceTest.kt b/src/test/kotlin/net/leanix/githubagent/services/GitHubAuthenticationServiceTest.kt index 639055a..8543776 100644 --- a/src/test/kotlin/net/leanix/githubagent/services/GitHubAuthenticationServiceTest.kt +++ b/src/test/kotlin/net/leanix/githubagent/services/GitHubAuthenticationServiceTest.kt @@ -4,7 +4,6 @@ import io.mockk.every import io.mockk.mockk import net.leanix.githubagent.client.GitHubClient import net.leanix.githubagent.config.GitHubEnterpriseProperties -import net.leanix.githubagent.exceptions.GitHubAppInsufficientPermissionsException import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Assertions.assertThrows import org.junit.jupiter.api.Test @@ -44,10 +43,7 @@ class GitHubAuthenticationServiceTest { every { cachingService.get(any()) } returns "dummy-value" every { githubEnterpriseProperties.pemFile } returns "invalid-private-key.pem" every { resourceLoader.getResource(any()) } returns ClassPathResource("invalid-private-key.pem") - every { gitHubEnterpriseService.verifyJwt(any()) } throws GitHubAppInsufficientPermissionsException("") - assertThrows(GitHubAppInsufficientPermissionsException::class.java) { - githubAuthenticationService.generateAndCacheJwtToken() - } + assertThrows(IllegalArgumentException::class.java) { githubAuthenticationService.generateAndCacheJwtToken() } } }