cleanup and added unit tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user