feature/implement-external-login-api #30
@@ -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<String> 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<String> 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user