diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index af5b18ade..a073fff0e 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -135,11 +135,18 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractRestIntegrationT @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests when max assignment is <= 0") + @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests when max assignment is smaller than 0") public void createSoftwareModuleTypesInvalidAssignmentBadRequest() throws JSONException, Exception { final List types = new ArrayList<>(); - types.add(entityFactory.generateSoftwareModuleType("test1", "TestName1", "Desc1", -1)); + types.add(entityFactory.generateSoftwareModuleType("test-1", "TestName-1", "Desc-1", -1)); + + mvc.perform(post("/rest/v1/softwaremoduletypes/").content(JsonBuilder.softwareModuleTypes(types)) + .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()); + + types.clear(); + types.add(entityFactory.generateSoftwareModuleType("test0", "TestName0", "Desc0", 0)); mvc.perform(post("/rest/v1/softwaremoduletypes/").content(JsonBuilder.softwareModuleTypes(types)) .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))