added final fileds
This commit is contained in:
@@ -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.
|
* Returns Token and status code OK when login is successful.
|
||||||
*
|
*
|
||||||
@@ -113,9 +117,9 @@ class HomeboxIntegrationTest {
|
|||||||
void shouldReturnServiceUnavailableWhenHomeboxUrlIsWrong() {
|
void shouldReturnServiceUnavailableWhenHomeboxUrlIsWrong() {
|
||||||
|
|
||||||
ConnectionRequest badRequest = new ConnectionRequest(
|
ConnectionRequest badRequest = new ConnectionRequest(
|
||||||
"http://localhost:1234",
|
MOCK_URL,
|
||||||
HOMEBOX.getValue(),
|
HOMEBOX.getValue(),
|
||||||
Map.of("username", "myUser", "password", "myPass"),
|
Map.of("username", TEST_USER, "password", TEST_PASS),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
ResponseEntity<String> response = restTemplate.postForEntity(LOGIN.getValue(), badRequest, String.class);
|
ResponseEntity<String> response = restTemplate.postForEntity(LOGIN.getValue(), badRequest, String.class);
|
||||||
@@ -144,9 +148,9 @@ class HomeboxIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
void shouldReturnProviderNotFound() {
|
void shouldReturnProviderNotFound() {
|
||||||
ConnectionRequest wrongServiceTypeReq = new ConnectionRequest(
|
ConnectionRequest wrongServiceTypeReq = new ConnectionRequest(
|
||||||
"http://localhost:1234",
|
MOCK_URL,
|
||||||
"wrong-service-type",
|
"wrong-service-type",
|
||||||
Map.of("username", "myUser", "password", "myPass"),
|
Map.of("username", TEST_USER, "password", TEST_PASS),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
ResponseEntity<String> response = restTemplate.postForEntity(LOGIN.getValue(), wrongServiceTypeReq,
|
ResponseEntity<String> response = restTemplate.postForEntity(LOGIN.getValue(), wrongServiceTypeReq,
|
||||||
@@ -198,7 +202,7 @@ class HomeboxIntegrationTest {
|
|||||||
*/
|
*/
|
||||||
private ConnectionRequest connectionRequest(WireMockRuntimeInfo wm) {
|
private ConnectionRequest connectionRequest(WireMockRuntimeInfo wm) {
|
||||||
return new ConnectionRequest(wm.getHttpBaseUrl(), HOMEBOX.getValue(),
|
return new ConnectionRequest(wm.getHttpBaseUrl(), HOMEBOX.getValue(),
|
||||||
Map.of("username", "admin", "password", "pw"),
|
Map.of("username", TEST_USER, "password", TEST_PASS),
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user