Skip to content

Commit

Permalink
test: fix KnowledgeGraph artifact select operation test to remove sol…
Browse files Browse the repository at this point in the history
…utions order
  • Loading branch information
cake-lier committed Dec 7, 2023
1 parent aa666c8 commit d620fd5
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import io.vertx.core.json.JsonObject;
import io.vertx.junit5.VertxExtension;
import io.vertx.junit5.VertxTestContext;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.hyperagents.yggdrasil.cartago.CartagoVerticle;
import org.hyperagents.yggdrasil.eventbus.messageboxes.HttpNotificationDispatcherMessagebox;
Expand Down Expand Up @@ -139,18 +141,21 @@ public void testSelectQuery(final VertxTestContext ctx) throws CartagoException
this.completionPromises
.get(1)
.future()
.onSuccess(r -> Assertions.assertArrayEquals(
new String[][][] {
new String[][]{
new String[]{"name", TEST_WORKSPACE_NAME},
new String[]{"uri", "http://localhost:8080/workspaces/test"}
},
new String[][]{
new String[]{"name", "sub"},
new String[]{"uri", "http://localhost:8080/workspaces/sub"}
}
},
(String[][][]) r,
.onSuccess(r -> Assertions.assertEquals(
Set.of(
List.of(
List.of("name", TEST_WORKSPACE_NAME),
List.of("uri", "http://localhost:8080/workspaces/test")
),
List.of(
List.of("name", "sub"),
List.of("uri", "http://localhost:8080/workspaces/sub")
)
),
Arrays.stream((String[][][]) r)
.map(Arrays::asList)
.map(e -> e.stream().map(Arrays::asList).toList())
.collect(Collectors.toSet()),
RESULTS_EQUAL_MESSAGE
))
.onComplete(ctx.succeedingThenComplete());
Expand Down

0 comments on commit d620fd5

Please sign in to comment.