From ddea6f26623024551bc7a390a2a983ed855ca00d Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 10 May 2024 10:06:11 +0200 Subject: [PATCH] update tests --- .../testingbotrest/TestingBotRestTest.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/testingbot/testingbotrest/TestingBotRestTest.java b/src/test/java/com/testingbot/testingbotrest/TestingBotRestTest.java index 14b951b..2761bd2 100644 --- a/src/test/java/com/testingbot/testingbotrest/TestingBotRestTest.java +++ b/src/test/java/com/testingbot/testingbotrest/TestingBotRestTest.java @@ -26,8 +26,8 @@ public void setUp() { @Test public void testUpdateTest() { - String sessionID = "6344353dcee24694bf39d5ee5e6e5b11"; - TestingbotTest test = this.api.getTest(sessionID); + TestingbotTest test = this.api.getTests(0, 1).getData().get(0); + String sessionId = test.getSessionId(); String randomMessage = UUID.randomUUID().toString(); HashMap details = new HashMap<>(); details.put("success", true); @@ -35,18 +35,19 @@ public void testUpdateTest() { ArrayList groups = new ArrayList<>(); groups.add("group1"); details.put("groups", groups); - boolean success = this.api.updateTest(sessionID, details); + boolean success = this.api.updateTest(sessionId, details); assertTrue(success); - TestingbotTest newTest = this.api.getTest(sessionID); + TestingbotTest newTest = this.api.getTest(sessionId); assertNotEquals(newTest.getStatusMessage(), test.getStatusMessage()); assertThat(newTest.getGroups(), hasItem("group1")); } @Test public void testUpdateTestViaObject() { - TestingbotTest test = this.api.getTest("6344353dcee24694bf39d5ee5e6e5b11"); + TestingbotTest test = this.api.getTests(0, 1).getData().get(0); + String sessionId = test.getSessionId(); TestingbotTest obj = new TestingbotTest(); - obj.setSessionId("6344353dcee24694bf39d5ee5e6e5b11"); + obj.setSessionId(sessionId); obj.setStatusMessage(UUID.randomUUID().toString()); ArrayList groups = new ArrayList<>(); groups.add("group2"); @@ -60,10 +61,8 @@ public void testUpdateTestViaObject() { @Test public void testGetTest() { - String sessionID = "6344353dcee24694bf39d5ee5e6e5b11"; - TestingbotTest test = this.api.getTest(sessionID); + TestingbotTest test = this.api.getTests(0, 1).getData().get(0); assertNotNull(test); - Assert.assertEquals(test.getSessionId(), sessionID); } @Test