@@ -53,14 +53,14 @@ public static void afterAll() throws IOException {
5353 }
5454
5555 @ Before
56- public void before () throws IOException {
56+ public void before () {
5757 if (!container .isRunning ()) {
5858 container .start ();
5959 }
6060 }
6161
6262 @ After
63- public void tearDown () throws InterruptedException {
63+ public void tearDown () {
6464 if (state .client != null ) {
6565 when ().post ("http://" + container .getLaunchpadUrl () + "/stop" )
6666 .then ()
@@ -70,7 +70,7 @@ public void tearDown() throws InterruptedException {
7070 }
7171
7272 @ Given ("a {} flagd provider" )
73- public void setupProvider (String providerType ) throws IOException , InterruptedException {
73+ public void setupProvider (String providerType ) throws InterruptedException {
7474 String flagdConfig = "default" ;
7575 state .builder .deadline (1000 ).keepAlive (0 ).retryGracePeriod (2 );
7676 boolean wait = true ;
@@ -125,28 +125,26 @@ public void setupProvider(String providerType) throws IOException, InterruptedEx
125125 .statusCode (200 );
126126
127127 // giving flagd a little time to start
128- Thread .sleep (30 );
128+ Thread .sleep (100 );
129129 FeatureProvider provider =
130130 new FlagdProvider (state .builder .resolverType (State .resolverType ).build ());
131131
132132 OpenFeatureAPI api = OpenFeatureAPI .getInstance ();
133- String providerName = providerType + Math .random ();
134133 if (wait ) {
135- api .setProviderAndWait (providerName , provider );
134+ api .setProviderAndWait (provider );
136135 } else {
137- api .setProvider (providerName , provider );
136+ api .setProvider (provider );
138137 }
139- log .info ("provider name: {}" , providerName );
140- this .state .client = api .getClient (providerName );
138+ this .state .client = api .getClient ();
141139 }
142140
143141 @ When ("the connection is lost" )
144- public void the_connection_is_lost () throws InterruptedException {
142+ public void the_connection_is_lost () {
145143 when ().post ("http://" + container .getLaunchpadUrl () + "/stop" ).then ().statusCode (200 );
146144 }
147145
148146 @ When ("the connection is lost for {int}s" )
149- public void the_connection_is_lost_for (int seconds ) throws InterruptedException {
147+ public void the_connection_is_lost_for (int seconds ) {
150148 when ().post ("http://" + container .getLaunchpadUrl () + "/restart?seconds={seconds}" , seconds )
151149 .then ()
152150 .statusCode (200 );
0 commit comments