Skip to content

Commit

Permalink
CID-2885: Updating appName topic
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlajmileanix committed Sep 6, 2024
1 parent afcd120 commit 0af269a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.leanix.githubagent.services.GitHubAuthenticationService
import net.leanix.githubagent.services.GitHubEnterpriseService
import net.leanix.githubagent.services.GitHubScanningService
import net.leanix.githubagent.services.WebSocketService
import net.leanix.githubagent.shared.AGENT_METADATA_TOPIC
import net.leanix.githubagent.shared.APP_NAME_TOPIC
import org.springframework.boot.ApplicationArguments
import org.springframework.boot.ApplicationRunner
import org.springframework.context.annotation.Profile
Expand All @@ -26,7 +26,7 @@ class PostStartupRunner(
githubAuthenticationService.generateAndCacheJwtToken()
val jwt = cachingService.get("jwt") as String
webSocketService.sendMessage(
AGENT_METADATA_TOPIC,
APP_NAME_TOPIC,
gitHubEnterpriseService.getGitHubApp(jwt).name
)
gitHubScanningService.scanGitHubResources()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/net/leanix/githubagent/shared/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.leanix.githubagent.shared

const val TOPIC_PREFIX = "/app/ghe/"
const val AGENT_METADATA_TOPIC = "agent"
const val APP_NAME_TOPIC = "appName"

enum class ManifestFileName(val fileName: String) {
YAML("leanix.yaml"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import net.leanix.githubagent.services.GitHubAuthenticationService
import net.leanix.githubagent.services.GitHubEnterpriseService
import net.leanix.githubagent.services.GitHubScanningService
import net.leanix.githubagent.services.WebSocketService
import net.leanix.githubagent.shared.AGENT_METADATA_TOPIC
import net.leanix.githubagent.shared.APP_NAME_TOPIC
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test

Expand Down Expand Up @@ -55,6 +55,6 @@ class PostStartupRunnerTest {

postStartupRunner.run(mockk())

verify { webSocketService.sendMessage(AGENT_METADATA_TOPIC, gitHubAppName) }
verify { webSocketService.sendMessage(APP_NAME_TOPIC, gitHubAppName) }
}
}

0 comments on commit 0af269a

Please sign in to comment.