File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
api/src/test/java/io/kafbat/ui Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1717import java .util .List ;
1818import java .util .Map ;
1919import java .util .UUID ;
20+ import java .util .concurrent .TimeUnit ;
2021import lombok .extern .slf4j .Slf4j ;
2122import org .junit .jupiter .api .AfterEach ;
2223import org .junit .jupiter .api .BeforeEach ;
@@ -44,6 +45,26 @@ public class KafkaConnectServiceTests extends AbstractIntegrationTest {
4445
4546 @ BeforeEach
4647 public void setUp () {
48+
49+ int limit = 5 ;
50+ int tries = 0 ;
51+ boolean failed = false ;
52+
53+ do {
54+ try {
55+ TimeUnit .SECONDS .sleep (1 );
56+ webTestClient .get ()
57+ .uri ("/api/clusters/{clusterName}/connects/{connectName}/connectors" , LOCAL ,
58+ connectName )
59+ .exchange ()
60+ .expectStatus ().isOk ();
61+ } catch (Exception e ) {
62+ failed = true ;
63+ System .out .println ("failed to retrieve connectors: " + tries );
64+ }
65+ tries ++;
66+ } while (failed == true && tries < limit );
67+
4768 webTestClient .post ()
4869 .uri ("/api/clusters/{clusterName}/connects/{connectName}/connectors" , LOCAL , connectName )
4970 .bodyValue (new NewConnectorDTO ()
You can’t perform that action at this time.
0 commit comments