Skip to content

Commit 1e7750b

Browse files
fix flaky test
1 parent c0eb91c commit 1e7750b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/test/java/com/testingbot/tunnel/HttpForwarderTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ void stop_shouldStopForwarder() {
4444
}
4545

4646
@Test
47-
void testForwarding_withRunningForwarder_shouldTestConnection() {
48-
// Given
47+
void testForwarding_withRunningForwarder_shouldExecuteWithoutException() {
48+
// Given: HttpForwarder with running Jetty server
4949
httpForwarder = new HttpForwarder(app);
50-
51-
// When
52-
boolean result = httpForwarder.testForwarding();
53-
54-
// Then
55-
assertThat(result).isFalse(); // Expected in test environment
56-
50+
51+
// When: Testing if forwarder is responding
52+
// Then: Should not throw exception (result depends on SSH tunnel availability)
53+
assertThatCode(() -> httpForwarder.testForwarding())
54+
.doesNotThrowAnyException();
55+
5756
// Clean up
5857
httpForwarder.stop();
5958
}

0 commit comments

Comments
 (0)