Skip to content

Commit

Permalink
Resolved conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
aali309 committed Jun 26, 2023
1 parent c19261e commit 53ef07e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Active getAuthenticated(DataFetchingEnvironment environment) throws Excep
String recordingName = filter.get(FilterInput.Key.NAME);
recordings =
recordings.stream()
.filter(r -> r.getName().equals(recordingName))
.filter(r -> Objects.equals(r.getName(), recordingName))
.collect(Collectors.toList());
}
if (filter.contains(FilterInput.Key.NAMES)) {
Expand Down
21 changes: 9 additions & 12 deletions src/test/java/itest/GraphQLIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -713,17 +713,14 @@ public void testQueryForFilteredActiveRecordingsByNames() throws Exception {

TargetNodesQueryResponse graphqlResp = resp2.get(REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS);

List<ActiveRecording> filteredRecordings = new ArrayList<>();
List<String> filterNames = Arrays.asList("Recording1", "Recording2");

for (TargetNode targetNode : graphqlResp.data.targetNodes) {
List<ActiveRecording> recordings = targetNode.recordings.active.data;
for (ActiveRecording recording : recordings) {
if (filterNames.contains(recording.name)) {
filteredRecordings.add(recording);
}
}
}
List<ActiveRecording> filteredRecordings =
graphqlResp.data.targetNodes.stream()
.flatMap(targetNode -> targetNode.recordings.active.data.stream())
.filter(recording -> filterNames.contains(recording.name))
.collect(Collectors.toList());

MatcherAssert.assertThat(filteredRecordings.size(), Matchers.equalTo(2));
ActiveRecording r1 = new ActiveRecording();
r1.name = "Recording1";
Expand Down Expand Up @@ -823,8 +820,6 @@ public void shouldReturnArchivedRecordingsFilteredByNames() throws Exception {

archiveRecordingFuture.get(REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS);

Thread.sleep(2_000L);

// retrieve to match the exact name
CompletableFuture<JsonArray> archivedRecordingsFuture2 = new CompletableFuture<>();
webClient
Expand All @@ -846,7 +841,9 @@ public void shouldReturnArchivedRecordingsFilteredByNames() throws Exception {
String query =
"query { targetNodes {"
+ "recordings {"
+ "archived(filter: { names: [\"archivedRecording\",\"someOtherName\"] }) {"
+ "archived(filter: { names: [\""
+ retrievedArchivedRecordingsName
+ "\",\"someOtherName\"] }) {"
+ "data {"
+ "name"
+ "}"
Expand Down

0 comments on commit 53ef07e

Please sign in to comment.