invalidCredentials

This commit is contained in:
Rob Winch
2021-05-07 13:58:56 -05:00
committed by Rob Winch
parent ca369ecc7c
commit 9b4c053a30

View File

@@ -94,4 +94,24 @@ class EmployeeServiceApplicationTest {
.jsonPath("data.employees[0].salary").isEqualTo("42");
}
@Test
void invalidCredentials() {
String query = "{" +
" employees{ " +
" name" +
" salary" +
" }" +
"}";
client.post().uri("")
.headers(h -> h.setBasicAuth("admin", "INVALID"))
.bodyValue("{ \"query\": \"" + query + "\"}")
.exchange()
.expectStatus().isUnauthorized()
.expectBody()
.isEmpty();
}
}