First designs for ui

This commit is contained in:
verboomp
2026-01-27 09:57:53 +01:00
parent f48bfe2107
commit 3d456128b1
16 changed files with 487 additions and 155 deletions

View File

@@ -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

View File

@@ -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");
}
}

View File

@@ -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
}
]