use plural for /api/packages too

This commit is contained in:
Michael Hoennig 2022-07-30 18:23:02 +02:00
parent fe4fef2752
commit 08804bd45c
2 changed files with 5 additions and 5 deletions

View File

@ -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<PackageEntity> listPackages(
@RequestHeader(value = "current-user") String userName,

View File

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