Skip to content

Commit

Permalink
Fixed unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesoliveira committed Jun 18, 2024
1 parent 62506fa commit 3115dd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RestServerTest {
doReturn(null).whenever(configProvider).getSSLKeyStorePassword()
doReturn(false).whenever(configProvider).isDevModeEnabled()
Assertions.assertThrows(
IllegalArgumentException::class.java,
Exception::class.java,
{
RestServerInternal(
JavalinRouteProviderImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Test
import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
import java.util.Base64
Expand All @@ -22,9 +22,10 @@ class DefaultCredentialResolverTest {
// https://github.com/mockito/mockito/issues/1943
private val req: HttpServletRequest = mock()
private val res: HttpServletResponse = mock()
private val ctx: Context = mock {
on { req() } doAnswer { req }
on { res() } doAnswer { res }
private val ctx = mock<Context>().apply {
whenever(req()).thenReturn(req)
whenever(res()).thenReturn(res)
whenever(header(any())).thenCallRealMethod()
}
private val context = ClientHttpRequestContext(ctx)
private val resolver = DefaultCredentialResolver()
Expand Down

0 comments on commit 3115dd4

Please sign in to comment.