From 2919cfaacd40ba53f32915bd0dacb443b1096d6e Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 6 Jul 2022 12:11:16 +0200 Subject: [PATCH] more integration tests --- .../integration/UseCasesIntegrationTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java index a1e0a24c..2f8d9264 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java @@ -2361,6 +2361,33 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { connectionPage = connectionPageRes.get(); assertNotNull(connectionPage); assertTrue(connectionPage.isEmpty()); + + final Result> connectionDatacall = restService + .getBuilder(GetFinishedExamClientConnectionPage.class) + .withURIVariable(API.PARAM_PARENT_MODEL_ID, exam.getModelId()) + .call(); + assertNotNull(connectionDatacall); + assertFalse(connectionDatacall.hasError()); + final Page ccDataPage = connectionDatacall.get(); + assertNotNull(ccDataPage); + assertFalse(ccDataPage.content.isEmpty()); + final ClientConnectionData clientConnectionData = ccDataPage.content.get(0); + assertNotNull(clientConnectionData); + assertEquals("DISABLED", clientConnectionData.clientConnection.status.toString()); + + final Result ccDataCall = restService + .getBuilder(GetFinishedExamClientConnection.class) + .withURIVariable(API.PARAM_MODEL_ID, clientConnectionData.getModelId()) + .call(); + + assertNotNull(ccDataCall); + assertFalse(ccDataCall.hasError()); + final ClientConnectionData clientConnectionData2 = ccDataCall.get(); + assertNotNull(clientConnectionData2); + assertEquals( + clientConnectionData2.clientConnection.connectionToken, + clientConnectionData.clientConnection.connectionToken); + } @Test