From 7500fc22b6eaece9e79630cb491a5aee1b8780ac Mon Sep 17 00:00:00 2001 From: George Andrinopoulos Date: Fri, 13 Dec 2024 12:21:50 +0200 Subject: [PATCH] CID-2940 Use 3 max attempts for retrying establishing connection --- .../githubagent/config/WebSocketClientConfigTests.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/net/leanix/githubagent/config/WebSocketClientConfigTests.kt b/src/test/kotlin/net/leanix/githubagent/config/WebSocketClientConfigTests.kt index cc35136..62c596f 100644 --- a/src/test/kotlin/net/leanix/githubagent/config/WebSocketClientConfigTests.kt +++ b/src/test/kotlin/net/leanix/githubagent/config/WebSocketClientConfigTests.kt @@ -22,6 +22,7 @@ class WebSocketClientConfigTests { private lateinit var authService: LeanIXAuthService private lateinit var leanIXProperties: LeanIXProperties private lateinit var gitHubEnterpriseProperties: GitHubEnterpriseProperties + private lateinit var leanIXAuthService: LeanIXAuthService @BeforeEach fun setUp() { @@ -32,7 +33,14 @@ class WebSocketClientConfigTests { stompClient = mockk() stompSession = mockk() authService = mockk() - webSocketClientConfig = WebSocketClientConfig(brokerStompSessionHandler, objectMapper, leanIXProperties) + leanIXAuthService = mockk() + webSocketClientConfig = WebSocketClientConfig( + brokerStompSessionHandler, + objectMapper, + leanIXAuthService, + leanIXProperties, + gitHubEnterpriseProperties + ) GitHubAgentProperties.GITHUB_AGENT_VERSION = "test-version" } @@ -43,6 +51,7 @@ class WebSocketClientConfigTests { coEvery { leanIXProperties.wsBaseUrl } returns "ws://test.url" coEvery { gitHubEnterpriseProperties.baseUrl } returns "http://github.enterprise.url" coEvery { gitHubEnterpriseProperties.gitHubAppId } returns "appId" + coEvery { leanIXAuthService.getBearerToken() } returns "bearer token" coEvery { stompClient.connectAsync( any(), any(),