Skip to content

Commit b6b41b6

Browse files
Merge pull request #26 from leanix/feature/CID-2885/send-GH-app-name-to-backend
CID-2885: Updating appName topic
2 parents 18bc6b6 + 2bdbd27 commit b6b41b6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/kotlin/net/leanix/githubagent/runners/PostStartupRunner.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import net.leanix.githubagent.services.GitHubAuthenticationService
66
import net.leanix.githubagent.services.GitHubEnterpriseService
77
import net.leanix.githubagent.services.GitHubScanningService
88
import net.leanix.githubagent.services.WebSocketService
9-
import net.leanix.githubagent.shared.AGENT_METADATA_TOPIC
9+
import net.leanix.githubagent.shared.APP_NAME_TOPIC
1010
import org.slf4j.LoggerFactory
1111
import org.springframework.boot.ApplicationArguments
1212
import org.springframework.boot.ApplicationRunner
@@ -35,7 +35,7 @@ class PostStartupRunner(
3535
githubAuthenticationService.generateAndCacheJwtToken()
3636
val jwt = cachingService.get("jwtToken") as String
3737
webSocketService.sendMessage(
38-
AGENT_METADATA_TOPIC,
38+
APP_NAME_TOPIC,
3939
gitHubEnterpriseService.getGitHubApp(jwt).name
4040
)
4141
gitHubScanningService.scanGitHubResources()

src/main/kotlin/net/leanix/githubagent/shared/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.leanix.githubagent.shared
22

33
const val TOPIC_PREFIX = "/app/ghe/"
4-
const val AGENT_METADATA_TOPIC = "agent"
4+
const val APP_NAME_TOPIC = "appName"
55
const val LOGS_TOPIC = "logs"
66

77
enum class ManifestFileName(val fileName: String) {

src/test/kotlin/net/leanix/githubagent/runners/PostStartupRunnerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import net.leanix.githubagent.services.GitHubAuthenticationService
1010
import net.leanix.githubagent.services.GitHubEnterpriseService
1111
import net.leanix.githubagent.services.GitHubScanningService
1212
import net.leanix.githubagent.services.WebSocketService
13-
import net.leanix.githubagent.shared.AGENT_METADATA_TOPIC
13+
import net.leanix.githubagent.shared.APP_NAME_TOPIC
1414
import org.junit.jupiter.api.BeforeEach
1515
import org.junit.jupiter.api.Test
1616

@@ -60,6 +60,6 @@ class PostStartupRunnerTest {
6060

6161
postStartupRunner.run(mockk())
6262

63-
verify { webSocketService.sendMessage(AGENT_METADATA_TOPIC, gitHubAppName) }
63+
verify { webSocketService.sendMessage(APP_NAME_TOPIC, gitHubAppName) }
6464
}
6565
}

0 commit comments

Comments
 (0)