added integration test for missing creds

This commit is contained in:
2026-04-09 21:18:52 +02:00
parent a1ebb1be21
commit 01fa3e4267
@@ -193,6 +193,18 @@ class HomeboxIntegrationTest {
}
}
@Test
void shouldReturnEmptyCredentialsExceptionWhenCredsAreMissing() {
ConnectionRequest missingCredentials = new ConnectionRequest(MOCK_URL, HOMEBOX.getValue(), TEST_USER, null,
false);
ResponseEntity<String> response = restTemplate.postForEntity(LOGIN.getValue(), missingCredentials,
String.class);
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST);
assertThat(response.getBody()).contains(BAD_REQUEST_EMPTY_FIELDS.getMessage());
}
/**
* Creates a valid connection request with a mock Api throuh
* WireMockRuntimeInfo.