cleanup and added unit tests

This commit is contained in:
verboomp
2026-01-27 14:09:12 +01:00
parent 3d456128b1
commit e4b2dd0462
42 changed files with 1467 additions and 977 deletions

View File

@@ -54,4 +54,25 @@ public class CustomerResourceTest extends AbstractRestTest {
String expected = fileToString(BASE_DOWNLOAD + "doGetAll.json");
jsonAssert(expected, text);
}
@Test
@Order(1)
public void doGetCustomer() throws IOException {
LOG.info("doGetCustomer");
String authorization = getAuthorization();
LOG.info("authorization: " + authorization);
String path = deploymentURL + PATH +"/1";
Request request = Request.Get(path).addHeader("Accept", "application/json; charset=utf-8")
.addHeader("Authorization", authorization);
HttpResponse httpResponse = executeRequest(request);
int code = httpResponse.getStatusLine().getStatusCode();
assertEquals(200, code);
String text = getResponseText(httpResponse, "doGetCustomer");
String expected = fileToString(BASE_DOWNLOAD + "doGetCustomer.json");
jsonAssert(expected, text);
}
}

View File

@@ -27,13 +27,11 @@ public class LoginResourceTest extends AbstractRestTest {
@Order(2)
public void doTestLogin() {
LOG.info("doTestLogin");
String token = getBasicHeader();
assertNotNull(token);
}
public static void main(String[] args) {
var test = new LoginResourceTest();
test.deploymentURL = "http://localhost:8080/";
String token = test.getAuthorization("hartmann", "nvlev4YnTi");

File diff suppressed because one or more lines are too long