Skip to content

Commit af7dbc7

Browse files
committed
Fix unit tests
1 parent 0126ee6 commit af7dbc7

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/test/java/com/uid2/admin/vertx/SharingServiceTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
import java.util.stream.Stream;
2727

2828
import 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.*;
3130
import static org.mockito.Mockito.*;
3231

3332
public 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

Comments
 (0)