Skip to content

Commit

Permalink
fixup! 15153: Implement new events pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalish committed Jul 25, 2024
1 parent 690fba7 commit b56a731
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import gov.cdc.prime.router.ActionLog
import gov.cdc.prime.router.ActionLogLevel
import gov.cdc.prime.router.FileSettings
import gov.cdc.prime.router.InvalidParamMessage
import gov.cdc.prime.router.Metadata
import gov.cdc.prime.router.MimeFormat
import gov.cdc.prime.router.Topic
import gov.cdc.prime.router.azure.MockHttpRequestMessage
Expand All @@ -22,8 +23,11 @@ import gov.cdc.prime.router.tokens.AuthenticatedClaims
import gov.cdc.prime.router.tokens.AuthenticationType
import gov.cdc.prime.router.tokens.oktaSystemAdminGroup
import gov.cdc.prime.router.unittest.UnitTestUtils
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockkObject
import io.mockk.unmockkAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
Expand Down Expand Up @@ -534,11 +538,19 @@ class SubmissionFunctionIntegrationTests {
}

@BeforeEach
fun setupAuth() {
fun setup() {
val jwt = mapOf("organization" to listOf(oktaSystemAdminGroup), "sub" to "[email protected]")
val claims = AuthenticatedClaims(jwt, AuthenticationType.Okta)
mockkObject(AuthenticatedClaims)
every { AuthenticatedClaims.authenticate(any()) } returns claims
mockkObject(Metadata)
every { Metadata.getInstance() } returns UnitTestUtils.simpleMetadata
}

@AfterEach
fun tearDown() {
clearAllMocks()
unmockkAll()
}

private fun setupSubmissionFunction(): SubmissionFunction {
Expand Down

0 comments on commit b56a731

Please sign in to comment.