First designs for ui
This commit is contained in:
Binary file not shown.
@@ -27,7 +27,6 @@ import org.junit.jupiter.api.TestMethodOrder;
|
||||
public class CustomerResourceTest extends AbstractRestTest {
|
||||
private static final Log LOG = LogFactory.getLog(CustomerResourceTest.class);
|
||||
private static final String PATH = "api/customer";
|
||||
private static final String BASE_UPLOAD = "src/test/resources/upload/";
|
||||
private static final String BASE_DOWNLOAD = "json/CustomerResourceTest-";
|
||||
|
||||
@BeforeAll
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package marketing.heyday.hartmann.fotodocumentation.rest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.fluent.Request;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
/**
|
||||
*
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: heyday Marketing GmbH</p>
|
||||
* @author <a href="mailto:p.verboom@heyday.marketing">Patrick Verboom</a>
|
||||
* @version 1.0
|
||||
*
|
||||
* created: 14 Nov 2024
|
||||
*/
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
public class PictureResourceTest extends AbstractRestTest {
|
||||
private static final Log LOG = LogFactory.getLog(PictureResourceTest.class);
|
||||
private static final String PATH = "api/picture";
|
||||
|
||||
@BeforeAll
|
||||
public static void init() {
|
||||
initDB();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
public void doDelete() throws IOException {
|
||||
LOG.info("doDelete");
|
||||
|
||||
assertEquals(5, pictureCount());
|
||||
|
||||
String path = deploymentURL + PATH + "/1";
|
||||
Request request = Request.Delete(path).addHeader("Accept", "application/json; charset=utf-8")
|
||||
.addHeader("Authorization", getAuthorization());
|
||||
|
||||
HttpResponse httpResponse = executeRequest(request);
|
||||
int code = httpResponse.getStatusLine().getStatusCode();
|
||||
assertEquals(200, code);
|
||||
|
||||
assertEquals(4, pictureCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
public void doDeleteNotFound() throws IOException {
|
||||
LOG.info("doDeleteNotFound");
|
||||
|
||||
assertEquals(5, pictureCount());
|
||||
|
||||
String path = deploymentURL + PATH + "/6000";
|
||||
Request request = Request.Delete(path).addHeader("Accept", "application/json; charset=utf-8")
|
||||
.addHeader("Authorization", getAuthorization());
|
||||
|
||||
HttpResponse httpResponse = executeRequest(request);
|
||||
int code = httpResponse.getStatusLine().getStatusCode();
|
||||
assertEquals(404, code);
|
||||
|
||||
assertEquals(5, pictureCount());
|
||||
}
|
||||
|
||||
private int pictureCount() {
|
||||
return getCount("select count(*) from picture");
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,20 @@
|
||||
[
|
||||
{
|
||||
"name": "Meier Apotheke",
|
||||
"customerNumber": "2345",
|
||||
"amountOfPicture": 1
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Müller Apotheke",
|
||||
"customerNumber": "1234",
|
||||
"amountOfPicture": 2
|
||||
"lastUpdateDate": 1729764570000
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Meier Apotheke",
|
||||
"customerNumber": "2345",
|
||||
"lastUpdateDate": 1729764570000
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Schmidt Apotheke",
|
||||
"customerNumber": "3456",
|
||||
"amountOfPicture": 2
|
||||
"lastUpdateDate": 1729764570000
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user