2626import java .util .stream .Stream ;
2727
2828import static com .uid2 .admin .vertx .Endpoints .API_SHARING_KEYSETS_RELATED ;
29- import static org .junit .jupiter .api .Assertions .assertEquals ;
30- import static org .junit .jupiter .api .Assertions .assertNotNull ;
29+ import static org .junit .jupiter .api .Assertions .*;
3130import static org .mockito .Mockito .*;
3231
3332public class SharingServiceTest extends ServiceTestBase {
@@ -1193,9 +1192,10 @@ void KeysetSetUpdateNullAllowedSites(Vertx vertx, VertxTestContext testContext)
11931192 post (vertx , testContext , "api/sharing/keyset" , body , response -> {
11941193 assertEquals (200 , response .statusCode ());
11951194
1196- AdminKeyset expected = new AdminKeyset (1 , 5 , "test" , null , Instant .now ().getEpochSecond (), true , true , Set .of (ClientType .DSP ));
1197- assertEquals ( null , response .bodyAsJsonObject ().getJsonArray ("allowed_sites" ));
1195+ AdminKeyset expected = new AdminKeyset (1 , 5 , "test" , Set . of () , Instant .now ().getEpochSecond (), true , true , Set .of (ClientType .DSP ));
1196+ compareKeysetListToResult ( expected , response .bodyAsJsonObject ().getJsonArray ("allowed_sites" ));
11981197 compareKeysetTypeListToResult (expected , response .bodyAsJsonObject ().getJsonArray ("allowed_types" ));
1198+ assertEquals (expected .getAllowedSites (), keysets .get (1 ).getAllowedSites ());
11991199
12001200 testContext .completeNow ();
12011201 });
@@ -1221,9 +1221,10 @@ void KeysetSetUpdateExplicitlyNullAllowedSites(Vertx vertx, VertxTestContext tes
12211221 post (vertx , testContext , "api/sharing/keyset" , body , response -> {
12221222 assertEquals (200 , response .statusCode ());
12231223
1224- AdminKeyset expected = new AdminKeyset (1 , 5 , "test" , null , Instant .now ().getEpochSecond (), true , true , Set .of (ClientType .DSP ));
1225- assertEquals ( null , response .bodyAsJsonObject ().getJsonArray ("allowed_sites" ));
1224+ AdminKeyset expected = new AdminKeyset (1 , 5 , "test" , Set . of () , Instant .now ().getEpochSecond (), true , true , Set .of (ClientType .DSP ));
1225+ compareKeysetListToResult ( expected , response .bodyAsJsonObject ().getJsonArray ("allowed_sites" ));
12261226 compareKeysetTypeListToResult (expected , response .bodyAsJsonObject ().getJsonArray ("allowed_types" ));
1227+ assertEquals (expected .getAllowedSites (), keysets .get (1 ).getAllowedSites ());
12271228
12281229 testContext .completeNow ();
12291230 });
0 commit comments