Skip to content

Commit

Permalink
Passed ITest
Browse files Browse the repository at this point in the history
  • Loading branch information
aali309 committed Jun 10, 2023
1 parent af6ad41 commit a7d33cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
50 changes: 21 additions & 29 deletions src/test/java/itest/GraphQLIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@

import io.cryostat.MainModule;
import io.cryostat.core.log.Logger;

import io.fabric8.kubernetes.client.http.HttpResponse;
import io.vertx.core.buffer.Buffer;
import com.google.gson.Gson;
import io.vertx.core.json.JsonObject;
import itest.bases.ExternalTargetsTest;
Expand Down Expand Up @@ -591,47 +592,38 @@ void testNodesHaveIds() throws Exception {
}
}
}

@Test
@Order(9)
void testQueryForSpecificTargetsByNames() throws Exception {
CompletableFuture<TargetNodesQueryResponse> resp = new CompletableFuture<>();
JsonObject query = new JsonObject();
query.put(
"query",
"query { targetNodes(filter: { names: [\"foo\", \"bar\", \"baz\"] }) { name"
+ " nodeType } }");
webClient
.post("/api/v2.2/graphql")
.sendJson(
query,
ar -> {
if (assertRequestStatus(ar, resp)) {
resp.complete(
gson.fromJson(
ar.result().bodyAsString(),
TargetNodesQueryResponse.class));
}
});
String query = String.format("query { targetNodes(filter: { names: [\"service:jmx:rmi:///jndi/rmi://cryostat-itests:9091/jmxrmi\", \"service:jmx:rmi:///jndi/rmi://cryostat-itests:9093/jmxrmi\"] }) { name nodeType } }");
webClient.post("/api/v2.2/graphql").sendJson(new JsonObject().put("query", query), ar -> {
if (assertRequestStatus(ar, resp)) {
System.out.println("++++Response Body: " + ar.result().bodyAsString());
resp.complete(gson.fromJson(ar.result().bodyAsString(), TargetNodesQueryResponse.class));
}
});
TargetNodesQueryResponse actual = resp.get(REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS);
List<TargetNode> targetNodes = actual.data.targetNodes;
int expectedSize = 3;

int expectedSize = 2;

System.out.println("++++Actual Size: " + targetNodes.size());
for (TargetNode targetNode : targetNodes) {
System.out.println("++++Target Node: " + targetNode.name);
}

assertThat(targetNodes.size(), is(expectedSize));

TargetNode target1 = new TargetNode();
target1.name = "foo";
target1.name = "service:jmx:rmi:///jndi/rmi://cryostat-itests:9091/jmxrmi";
target1.nodeType = "JVM";
TargetNode target2 = new TargetNode();
target2.name = "bar";
target2.name = "service:jmx:rmi:///jndi/rmi://cryostat-itests:9093/jmxrmi";
target2.nodeType = "JVM";
TargetNode target3 = new TargetNode();
target3.name = "baz";
target3.nodeType = "JVM";


assertThat(targetNodes, hasItem(target1));
assertThat(targetNodes, hasItem(target2));
assertThat(targetNodes, hasItem(target3));

}

static class Target {
Expand Down
2 changes: 1 addition & 1 deletion web-client
Submodule web-client updated 54 files
+0 −36 .github/workflows/ci-preview.yml
+26 −44 README.md
+1 −1 TESTING.md
+2 −7 src/app/About/AboutCryostatModal.tsx
+2 −2 src/app/About/AboutDescription.tsx
+3 −1 src/app/Dashboard/AutomatedAnalysis/ClickableAutomatedAnalysisLabel.tsx
+1 −1 src/app/Dashboard/DashboardCardActionMenu.tsx
+1 −1 src/app/Dashboard/DashboardLayoutToolbar.tsx
+5 −1 src/app/Dashboard/DraggableRef.tsx
+1 −1 src/app/Dashboard/ResizableRef.tsx
+1 −1 src/app/DateTimePicker/TimezonePicker.tsx
+4 −1 src/app/Events/EventTemplates.tsx
+1 −1 src/app/Login/OpenShiftPlaceholderAuthForm.tsx
+1 −1 src/app/Modal/CancelUploadModal.tsx
+1 −1 src/app/NotFound/NotFound.tsx
+22 −7 src/app/Notifications/NotificationCenter.tsx
+1 −1 src/app/QuickStarts/QuickStartsCatalogPage.tsx
+1 −1 src/app/RecordingMetadata/BulkEditLabels.tsx
+1 −1 src/app/RecordingMetadata/ClickableLabel.tsx
+1 −1 src/app/RecordingMetadata/LabelCell.tsx
+5 −1 src/app/RecordingMetadata/RecordingLabelFields.tsx
+2 −2 src/app/Recordings/ActiveRecordingsTable.tsx
+1 −1 src/app/Recordings/Filters/DatetimeFilter.tsx
+1 −1 src/app/Recordings/Filters/LabelFilter.tsx
+1 −1 src/app/Recordings/Filters/NameFilter.tsx
+4 −1 src/app/Recordings/Filters/RecordingStateFilter.tsx
+1 −1 src/app/Recordings/RecordingActions.tsx
+1 −1 src/app/Recordings/RecordingLabelsPanel.tsx
+1 −1 src/app/Recordings/RecordingsTable.tsx
+1 −1 src/app/Recordings/ReportFrame.tsx
+1 −1 src/app/SecurityPanel/CertificateUploadModal.tsx
+1 −1 src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx
+1 −1 src/app/SecurityPanel/Credentials/MatchedTargetsTable.tsx
+1 −1 src/app/SecurityPanel/ImportCertificate.tsx
+2 −2 src/app/SecurityPanel/SecurityPanel.tsx
+2 −2 src/app/Settings/SettingsUtils.ts
+6 −2 src/app/Shared/FeatureFlag/FeatureFlag.tsx
+1 −1 src/app/Shared/FileUploads.tsx
+1 −1 src/app/Shared/SelectTemplateSelectorForm.tsx
+1 −1 src/app/Shared/SerializedTarget.tsx
+1 −1 src/app/Shared/Services/Api.service.tsx
+5 −1 src/app/Shared/Services/Login.service.tsx
+8 −5 src/app/Shared/Services/NotificationChannel.service.tsx
+1 −1 src/app/Shared/TargetSelect.tsx
+1 −1 src/app/TargetView/NoTargetSelected.tsx
+1 −1 src/app/TargetView/TargetView.tsx
+6 −11 src/app/Topology/Actions/NodeActions.tsx
+3 −22 src/app/Topology/Shared/Entity/EntityDetails.tsx
+49 −0 src/app/Topology/Shared/TranslatedText.tsx
+4 −16 src/app/Topology/Shared/utils.tsx
+1 −1 src/app/Topology/Toolbar/TopologyToolbar.tsx
+3 −1 src/app/index.tsx
+1 −1 src/app/routes.tsx
+310 −0 src/test/resources/mockDiscoveryResponse.json

0 comments on commit a7d33cb

Please sign in to comment.