Skip to content

Commit

Permalink
CID-3369: adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlajmileanix committed Jan 2, 2025
1 parent 0c6f920 commit 4132f31
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import io.mockk.just
import io.mockk.runs
import io.mockk.verify
import net.leanix.githubagent.client.GitHubClient
import net.leanix.githubagent.dto.Account
import net.leanix.githubagent.dto.Installation
import net.leanix.githubagent.dto.ManifestFileAction
import net.leanix.githubagent.dto.ManifestFileUpdateDto
import net.leanix.githubagent.dto.Organization
Expand Down Expand Up @@ -41,12 +43,18 @@ class WebhookEventServiceTest {
@Autowired
private lateinit var webhookEventService: WebhookEventService

private val permissions = mapOf("administration" to "read", "contents" to "read", "metadata" to "read")
private val events = listOf("label", "public", "repository", "push")

@BeforeEach
fun setUp() {
val installation = Installation(1, Account("testInstallation"), permissions, events)
every { gitHubAuthenticationService.refreshTokens() } returns Unit
every { webSocketService.sendMessage(any(), any()) } returns Unit
every { cachingService.get(any()) } returns "token"
every { gitHubGraphQLService.getManifestFileContent(any(), any(), any(), any()) } returns "content"
every { gitHubClient.getInstallations(any()) } returns listOf(installation)
every { gitHubClient.getInstallation(any(), any()) } returns installation
}

@Test
Expand Down

0 comments on commit 4132f31

Please sign in to comment.