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; private PackageRepository packageRepository;
@ResponseBody @ResponseBody
@RequestMapping(value = "/api/package", method = RequestMethod.GET) @RequestMapping(value = "/api/packages", method = RequestMethod.GET)
@Transactional @Transactional
public List<PackageEntity> listPackages( public List<PackageEntity> listPackages(
@RequestHeader(value = "current-user") String userName, @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; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@WebMvcTest(PackageController.class) @WebMvcTest(PackageController.class)
class PackageControllerTest { class PackageControllerRestTest {
final CustomerEntity cust = new CustomerEntity(UUID.randomUUID(), "xyz", 10001, "xyz@example.com"); final CustomerEntity cust = new CustomerEntity(UUID.randomUUID(), "xyz", 10001, "xyz@example.com");
final PackageEntity pac00 = new PackageEntity(UUID.randomUUID(), "xyz00", cust); final PackageEntity pac00 = new PackageEntity(UUID.randomUUID(), "xyz00", cust);
@ -30,9 +30,9 @@ class PackageControllerTest {
@Autowired @Autowired
MockMvc mockMvc; MockMvc mockMvc;
@MockBean @MockBean
private Context contextMock; Context contextMock;
@MockBean @MockBean
private PackageRepository packageRepositoryMock; PackageRepository packageRepositoryMock;
@Test @Test
void findAll() throws Exception { void findAll() throws Exception {
@ -43,7 +43,7 @@ class PackageControllerTest {
// when // when
final var pacs = mockMvc.perform(MockMvcRequestBuilders final var pacs = mockMvc.perform(MockMvcRequestBuilders
.get("/api/package") .get("/api/packages")
.header("current-user", "mike@hostsharing.net") .header("current-user", "mike@hostsharing.net")
.header("assumed-roles", "customer#xyz.admin") .header("assumed-roles", "customer#xyz.admin")
.accept(MediaType.APPLICATION_JSON)) .accept(MediaType.APPLICATION_JSON))