diff --git a/backend/src/test/java/com/vaessl/app/connection/HomeboxIntegrationTest.java b/backend/src/test/java/com/vaessl/app/connection/HomeboxIntegrationTest.java index be6fa09..2f7cf3c 100644 --- a/backend/src/test/java/com/vaessl/app/connection/HomeboxIntegrationTest.java +++ b/backend/src/test/java/com/vaessl/app/connection/HomeboxIntegrationTest.java @@ -43,6 +43,10 @@ class HomeboxIntegrationTest { } """; + private static final String MOCK_URL = "http://localhost:1234"; + private static final String TEST_USER = "admin"; + private static final String TEST_PASS = "pw"; + /** * Returns Token and status code OK when login is successful. * @@ -113,9 +117,9 @@ class HomeboxIntegrationTest { void shouldReturnServiceUnavailableWhenHomeboxUrlIsWrong() { ConnectionRequest badRequest = new ConnectionRequest( - "http://localhost:1234", + MOCK_URL, HOMEBOX.getValue(), - Map.of("username", "myUser", "password", "myPass"), + Map.of("username", TEST_USER, "password", TEST_PASS), false); ResponseEntity response = restTemplate.postForEntity(LOGIN.getValue(), badRequest, String.class); @@ -144,9 +148,9 @@ class HomeboxIntegrationTest { @Test void shouldReturnProviderNotFound() { ConnectionRequest wrongServiceTypeReq = new ConnectionRequest( - "http://localhost:1234", + MOCK_URL, "wrong-service-type", - Map.of("username", "myUser", "password", "myPass"), + Map.of("username", TEST_USER, "password", TEST_PASS), false); ResponseEntity response = restTemplate.postForEntity(LOGIN.getValue(), wrongServiceTypeReq, @@ -198,7 +202,7 @@ class HomeboxIntegrationTest { */ private ConnectionRequest connectionRequest(WireMockRuntimeInfo wm) { return new ConnectionRequest(wm.getHttpBaseUrl(), HOMEBOX.getValue(), - Map.of("username", "admin", "password", "pw"), + Map.of("username", TEST_USER, "password", TEST_PASS), null); } }