From 08804bd45cf8ef5e9411c8778946cde6a3d00687 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Sat, 30 Jul 2022 18:23:02 +0200 Subject: [PATCH] use plural for /api/packages too --- .../hsadminng/hspackage/PackageController.java | 2 +- ...ControllerTest.java => PackageControllerRestTest.java} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/test/java/net/hostsharing/hsadminng/hspackage/{PackageControllerTest.java => PackageControllerRestTest.java} (93%) diff --git a/src/main/java/net/hostsharing/hsadminng/hspackage/PackageController.java b/src/main/java/net/hostsharing/hsadminng/hspackage/PackageController.java index 1441c67f..19f0b48c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hspackage/PackageController.java +++ b/src/main/java/net/hostsharing/hsadminng/hspackage/PackageController.java @@ -21,7 +21,7 @@ public class PackageController { private PackageRepository packageRepository; @ResponseBody - @RequestMapping(value = "/api/package", method = RequestMethod.GET) + @RequestMapping(value = "/api/packages", method = RequestMethod.GET) @Transactional public List listPackages( @RequestHeader(value = "current-user") String userName, diff --git a/src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerTest.java b/src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerRestTest.java similarity index 93% rename from src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerTest.java rename to src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerRestTest.java index aae210ce..bb5957be 100644 --- a/src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hspackage/PackageControllerRestTest.java @@ -21,7 +21,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @WebMvcTest(PackageController.class) -class PackageControllerTest { +class PackageControllerRestTest { final CustomerEntity cust = new CustomerEntity(UUID.randomUUID(), "xyz", 10001, "xyz@example.com"); final PackageEntity pac00 = new PackageEntity(UUID.randomUUID(), "xyz00", cust); @@ -30,9 +30,9 @@ class PackageControllerTest { @Autowired MockMvc mockMvc; @MockBean - private Context contextMock; + Context contextMock; @MockBean - private PackageRepository packageRepositoryMock; + PackageRepository packageRepositoryMock; @Test void findAll() throws Exception { @@ -43,7 +43,7 @@ class PackageControllerTest { // when final var pacs = mockMvc.perform(MockMvcRequestBuilders - .get("/api/package") + .get("/api/packages") .header("current-user", "mike@hostsharing.net") .header("assumed-roles", "customer#xyz.admin") .accept(MediaType.APPLICATION_JSON))