diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/builder/JpaTagBuilder.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/builder/JpaTagBuilder.java index 6291f8717..79f76f4a4 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/builder/JpaTagBuilder.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/builder/JpaTagBuilder.java @@ -12,6 +12,7 @@ import org.eclipse.hawkbit.repository.builder.GenericTagUpdate; import org.eclipse.hawkbit.repository.builder.TagBuilder; import org.eclipse.hawkbit.repository.builder.TagCreate; import org.eclipse.hawkbit.repository.builder.TagUpdate; +import org.eclipse.hawkbit.repository.model.Tag; /** * Builder implementation for {@link Tag}. diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/TestdataFactory.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/TestdataFactory.java index 4f356a336..f4d4dfa6b 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/TestdataFactory.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/TestdataFactory.java @@ -782,7 +782,7 @@ public class TestdataFactory { public SoftwareModuleType findOrCreateSoftwareModuleType(final String key, final int maxAssignments) { return softwareModuleTypeManagement.getByKey(key) .orElseGet(() -> softwareModuleTypeManagement.create(entityFactory.softwareModuleType().create() - .key(key).name(key).description(LOREM.words(10)).maxAssignments(maxAssignments))); + .key(key).name(key).description(LOREM.words(10)).colour("#ffffff").maxAssignments(maxAssignments))); } /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java index ef20d85d7..591de724b 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java @@ -32,9 +32,12 @@ public class MgmtDistributionSetType extends MgmtNamedEntity { @JsonProperty(required = true) private String key; - + @JsonProperty private boolean deleted; + + @JsonProperty + private String colour; public boolean isDeleted() { return deleted; @@ -74,4 +77,19 @@ public class MgmtDistributionSetType extends MgmtNamedEntity { this.key = key; } + /** + * @return the colour + */ + public String getColour() { + return colour; + } + + /** + * @param colour + * the colour to set + */ + public void setColour(String colour) { + this.colour = colour; + } + } diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java index c5912a78a..ef9564369 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java @@ -36,6 +36,9 @@ public class MgmtSoftwareModuleType extends MgmtNamedEntity { @JsonProperty private boolean deleted; + @JsonProperty + private String colour; + public boolean isDeleted() { return deleted; } @@ -68,4 +71,11 @@ public class MgmtSoftwareModuleType extends MgmtNamedEntity { this.maxAssignments = maxAssignments; } + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } } diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java index 9c3f432ad..9d1c81bc8 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java @@ -45,7 +45,7 @@ public class MgmtTargetType extends MgmtNamedEntity { /** * - * @return the color in format #000000 + * @return the colour */ public String getColour() { return colour; @@ -53,7 +53,7 @@ public class MgmtTargetType extends MgmtNamedEntity { /** * @param colour - * in format #000000 + * the colour to set */ public void setColour(String colour) { this.colour = colour; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index d0aa09d07..26c8753db 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -28,8 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; /** - * REST Resource handling for SoftwareModule and related Artifact CRUD - * operations. + * REST Resource handling for DistributionSet CRUD operations. * */ @RequestMapping(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) @@ -68,9 +67,9 @@ public interface MgmtDistributionSetTypeRestApi { * within. * * @param distributionSetTypeId - * the ID of the module type to retrieve + * the ID of the DS type to retrieve * - * @return a single softwareModule with status OK. + * @return a single DS type with status OK. */ @GetMapping(value = "/{distributionSetTypeId}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) @@ -92,9 +91,9 @@ public interface MgmtDistributionSetTypeRestApi { * Handles the PUT request of updating a Distribution Set Type. * * @param distributionSetTypeId - * the ID of the software module in the URL + * the ID of the DS type in the URL * @param restDistributionSetType - * the module type to be updated. + * the DS type to be updated. * @return status OK if update is successful */ @PutMapping(value = "/{distributionSetTypeId}", consumes = { MediaTypes.HAL_JSON_VALUE, diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java index 7f438eaae..21e921af0 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java @@ -83,6 +83,7 @@ final class MgmtDistributionSetTypeMapper { result.setKey(type.getKey()); result.setModuleId(type.getId()); result.setDeleted(type.isDeleted()); + result.setColour(type.getColour()); result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(result.getModuleId())) .withSelfRel()); diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java index ae9ed9089..f71f72e20 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java @@ -25,9 +25,7 @@ import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.exception.SoftwareModuleTypeNotInDistributionSetTypeException; -import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSetType; -import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -41,8 +39,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * REST Resource handling for {@link SoftwareModule} and related - * {@link Artifact} CRUD operations. + * REST Resource handling for {@link DistributionSetType} CRUD operations. */ @RestController public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeRestApi { diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java index 47900b4d2..61ce58912 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java @@ -69,6 +69,7 @@ final class MgmtSoftwareModuleTypeMapper { result.setMaxAssignments(type.getMaxAssignments()); result.setModuleId(type.getId()); result.setDeleted(type.isDeleted()); + result.setColour(type.getColour()); result.add(linkTo(methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(result.getModuleId())) .withSelfRel()); diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java index 3b71a09e5..b6d95a7f6 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java @@ -35,8 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * REST Resource handling for {@link SoftwareModule} and related - * {@link Artifact} CRUD operations. + * REST Resource handling for {@link SoftwareModuleType} CRUD operations. * */ @RestController diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java index 25450b069..e9ccdf258 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java @@ -82,6 +82,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn .andExpect(jsonPath("$.content.[?(@.key=='test123')].id", contains(testType.getId().intValue()))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].name", contains("TestName123"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].description", contains("Desc1234"))) + .andExpect(jsonPath("$.content.[?(@.key=='test123')].colour", contains("col12"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].createdBy", contains("uploadTester"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].createdAt", contains(testType.getCreatedAt()))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].lastModifiedBy", contains("uploadTester"))) @@ -110,6 +111,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn .andExpect(jsonPath("$.content.[0].id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$.content.[0].name", equalTo("TestName123"))) .andExpect(jsonPath("$.content.[0].description", equalTo("Desc1234"))) + .andExpect(jsonPath("$.content.[0].colour", equalTo("col12"))) .andExpect(jsonPath("$.content.[0].createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("$.content.[0].createdAt", equalTo(testType.getCreatedAt()))) .andExpect(jsonPath("$.content.[0].lastModifiedBy", equalTo("uploadTester"))) @@ -124,6 +126,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn .andExpect(jsonPath("$.content.[4].id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$.content.[4].name", equalTo("TestName123"))) .andExpect(jsonPath("$.content.[4].description", equalTo("Desc1234"))) + .andExpect(jsonPath("$.content.[4].colour", equalTo("col12"))) .andExpect(jsonPath("$.content.[4].createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("$.content.[4].createdAt", equalTo(testType.getCreatedAt()))) .andExpect(jsonPath("$.content.[4].lastModifiedBy", equalTo("uploadTester"))) @@ -178,6 +181,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn .andExpect(jsonPath("[0].name", equalTo("TestName1"))) .andExpect(jsonPath("[0].key", equalTo("testKey1"))) .andExpect(jsonPath("[0].description", equalTo("Desc1"))) + .andExpect(jsonPath("[0].colour", equalTo("col"))) .andExpect(jsonPath("[0].createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("[1].name", equalTo("TestName2"))) .andExpect(jsonPath("[1].key", equalTo("testKey2"))) @@ -411,7 +415,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn public void getDistributionSetType() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType().create() - .key("test123").name("TestName123").description("Desc123").colour("col12")); + .key("test123").name("TestName123").description("Desc123")); testType = distributionSetTypeManagement .update(entityFactory.distributionSetType().update(testType.getId()).description("Desc1234")); @@ -420,6 +424,7 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.name", equalTo("TestName123"))) .andExpect(jsonPath("$.description", equalTo("Desc1234"))) + .andExpect(jsonPath("$.colour").doesNotExist()) .andExpect(jsonPath("$.createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt()))) .andExpect(jsonPath("$.lastModifiedBy", equalTo("uploadTester"))) @@ -476,17 +481,19 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn @Test @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} PUT requests.") - public void updateDistributionSetTypeOnlyDescriptionAndNameUntouched() throws Exception { + public void updateDistributionSetTypeColourDescriptionAndNameUntouched() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() .create().key("test123").name("TestName123").description("Desc123").colour("col")); final String body = new JSONObject().put("id", testType.getId()).put("description", "foobardesc") + .put("colour", "updatedColour") .put("name", "nameShouldNotBeChanged").toString(); mvc.perform(put("/rest/v1/distributionsettypes/{smId}", testType.getId()).content(body) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$.description", equalTo("foobardesc"))) + .andExpect(jsonPath("$.colour", equalTo("updatedColour"))) .andExpect(jsonPath("$.name", equalTo("TestName123"))).andReturn(); } @@ -550,10 +557,6 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn @Test @Description("Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.).") public void invalidRequestsOnDistributionSetTypesResource() throws Exception { - // final DistributionSetType testDsType = distributionSetManagement - // .createDistributionSetType(entityFactory.distributionSetType().create().key("test123") - // .name("TestName123").description("Desc123").colour("col")); - final SoftwareModuleType testSmType = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("test123").name("TestName123")); diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index 3a75d412b..f4487f327 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -63,6 +63,7 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath("$.content.[?(@.key=='" + osType.getKey() + "')].name", contains(osType.getName()))) .andExpect(jsonPath("$.content.[?(@.key=='" + osType.getKey() + "')].description", contains(osType.getDescription()))) + .andExpect(jsonPath("$.content.[?(@.key=='" + osType.getKey() + "')].colour").doesNotExist()) .andExpect(jsonPath("$.content.[?(@.key=='" + osType.getKey() + "')].maxAssignments", contains(1))) .andExpect(jsonPath("$.content.[?(@.key=='" + osType.getKey() + "')].key", contains("os"))) .andExpect(jsonPath("$.content.[?(@.key=='" + runtimeType.getKey() + "')].name", @@ -75,12 +76,14 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt jsonPath("$.content.[?(@.key=='" + appType.getKey() + "')].name", contains(appType.getName()))) .andExpect(jsonPath("$.content.[?(@.key=='" + appType.getKey() + "')].description", contains(appType.getDescription()))) + .andExpect(jsonPath("$.content.[?(@.key=='" + appType.getKey() + "')].colour").doesNotExist()) .andExpect(jsonPath("$.content.[?(@.key=='" + appType.getKey() + "')].maxAssignments", contains(Integer.MAX_VALUE))) .andExpect(jsonPath("$.content.[?(@.key=='" + appType.getKey() + "')].key", contains("application"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].id", contains(testType.getId().intValue()))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].name", contains("TestName123"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].description", contains("Desc1234"))) + .andExpect(jsonPath("$.content.[?(@.key=='test123')].colour", contains("colour"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].createdBy", contains("uploadTester"))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].createdAt", contains(testType.getCreatedAt()))) .andExpect(jsonPath("$.content.[?(@.key=='test123')].lastModifiedBy", contains("uploadTester"))) @@ -93,7 +96,7 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt private SoftwareModuleType createTestType() { SoftwareModuleType testType = softwareModuleTypeManagement.create(entityFactory.softwareModuleType().create() - .key("test123").name("TestName123").description("Desc123").maxAssignments(5)); + .key("test123").name("TestName123").description("Desc123").colour("colour").maxAssignments(5)); testType = softwareModuleTypeManagement .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234")); return testType; @@ -113,6 +116,7 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath("$.content.[1].id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$.content.[1].name", equalTo("TestName123"))) .andExpect(jsonPath("$.content.[1].description", equalTo("Desc1234"))) + .andExpect(jsonPath("$.content.[1].colour", equalTo("colour"))) .andExpect(jsonPath("$.content.[1].createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("$.content.[1].createdAt", equalTo(testType.getCreatedAt()))) .andExpect(jsonPath("$.content.[1].lastModifiedBy", equalTo("uploadTester"))) @@ -219,6 +223,7 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.name", equalTo("TestName123"))) .andExpect(jsonPath("$.description", equalTo("Desc1234"))) + .andExpect(jsonPath("$.colour", equalTo("colour"))) .andExpect(jsonPath("$.maxAssignments", equalTo(5))) .andExpect(jsonPath("$.createdBy", equalTo("uploadTester"))) .andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt()))) @@ -272,16 +277,17 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt @Test @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} PUT requests.") - public void updateSoftwareModuleTypeOnlyDescriptionAndNameUntouched() throws Exception { + public void updateSoftwareModuleTypeColourDescriptionAndNameUntouched() throws Exception { final SoftwareModuleType testType = createTestType(); final String body = new JSONObject().put("id", testType.getId()).put("description", "foobardesc") - .put("name", "nameShouldNotBeChanged").toString(); + .put("colour", "updatedColour").put("name", "nameShouldNotBeChanged").toString(); mvc.perform(put("/rest/v1/softwaremoduletypes/{smId}", testType.getId()).content(body) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$.description", equalTo("foobardesc"))) + .andExpect(jsonPath("$.colour", equalTo("updatedColour"))) .andExpect(jsonPath("$.name", equalTo("TestName123"))).andReturn(); } diff --git a/hawkbit-rest/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java b/hawkbit-rest/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java index 1046a7346..de3f63f0e 100644 --- a/hawkbit-rest/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java +++ b/hawkbit-rest/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java @@ -148,7 +148,7 @@ public abstract class JsonBuilder { int i = 0; for (final SoftwareModuleType module : types) { builder.append(new JSONObject().put("name", module.getName()).put("description", module.getDescription()) - .put("id", Long.MAX_VALUE).put("key", module.getKey()) + .put("colour", module.getColour()).put("id", Long.MAX_VALUE).put("key", module.getKey()) .put("maxAssignments", module.getMaxAssignments()).put("createdAt", "0").put("updatedAt", "0") .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh").toString()); @@ -171,7 +171,8 @@ public abstract class JsonBuilder { int i = 0; for (final SoftwareModuleType module : types) { builder.append(new JSONObject().put("name", module.getName()).put("description", module.getDescription()) - .put("key", module.getKey()).put("maxAssignments", module.getMaxAssignments()).toString()); + .put("colour", module.getColour()).put("key", module.getKey()) + .put("maxAssignments", module.getMaxAssignments()).toString()); if (++i < types.size()) { builder.append(","); @@ -298,9 +299,10 @@ public abstract class JsonBuilder { }); result.put(new JSONObject().put("name", type.getName()).put("description", type.getDescription()) - .put("id", Long.MAX_VALUE).put("key", type.getKey()).put("createdAt", "0").put("updatedAt", "0") - .put("createdBy", "fghdfkjghdfkjh").put("optionalmodules", osmTypes) - .put("mandatorymodules", msmTypes).put("updatedBy", "fghdfkjghdfkjh")); + .put("colour", type.getColour()).put("id", Long.MAX_VALUE).put("key", type.getKey()) + .put("createdAt", "0").put("updatedAt", "0").put("createdBy", "fghdfkjghdfkjh") + .put("optionalmodules", osmTypes).put("mandatorymodules", msmTypes) + .put("updatedBy", "fghdfkjghdfkjh")); } @@ -330,7 +332,7 @@ public abstract class JsonBuilder { }); result.put(new JSONObject().put("name", module.getName()).put("description", module.getDescription()) - .put("key", module.getKey()).put("optionalmodules", osmTypes) + .put("colour", module.getColour()).put("key", module.getKey()).put("optionalmodules", osmTypes) .put("mandatorymodules", msmTypes)); } catch (final JSONException e) { e.printStackTrace(); diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsets-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsets-api-guide.adoc index 0c1975d07..40f0d00a5 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsets-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsets-api-guide.adoc @@ -15,7 +15,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all distribution sets within SP. Required permission: READ_REPOSITORY +Handles the GET request of retrieving all distribution sets within Hawkbit. Required permission: READ_REPOSITORY === Get paged list of Distribution Sets @@ -62,7 +62,7 @@ include::../errors/429.adoc[] == POST /rest/v1/distributionsets === Implementation Notes -Handles the POST request of creating new distribution sets within SP. The request body must always be a list of sets. Required permission: CREATE_REPOSITORY +Handles the POST request of creating new distribution sets within Hawkbit. The request body must always be a list of sets. Required permission: CREATE_REPOSITORY === Create Distribution Sets @@ -111,7 +111,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for a single Distribution Set within SP. Required permission: DELETE_REPOSITORY +Handles the DELETE request for a single Distribution Set within Hawkbit. Required permission: DELETE_REPOSITORY === Delete Distribution Set @@ -151,7 +151,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving a single distribution set within SP. Required permission: READ_REPOSITORY +Handles the GET request of retrieving a single distribution set within Hawkbit. Required permission: READ_REPOSITORY === Get Distribution Set @@ -196,7 +196,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the UPDATE request for a single Distribution Set within SP. Required permission: UPDATE_REPOSITORY +Handles the UPDATE request for a single Distribution Set within Hawkbit. Required permission: UPDATE_REPOSITORY === Updating a Distribution Set @@ -246,7 +246,7 @@ include::../errors/429.adoc[] == GET /rest/v1/distributionsets/{distributionSetId}/assignedSM === Implementation Notes -Handles the GET request of retrieving a single distribution set within SP. Required permission: READ_REPOSITORY +Handles the GET request of retrieving a single distribution set within Hawkbit. Required permission: READ_REPOSITORY === Get assigned Software Modules diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsettypes-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsettypes-api-guide.adoc index c1398a1be..26a45f2ec 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsettypes-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/distributionsettypes-api-guide.adoc @@ -15,7 +15,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all distribution set types withinfGET /rest/v1/distributionsettypes SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving all distribution set types within Hawkbit. Required Permission: READ_REPOSITORY === Get distribution set types @@ -63,7 +63,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the POST request for creating new distribution set types within SP. The request body must always be a list of types. Required Permission: CREATE_REPOSITORY +Handles the POST request for creating new distribution set types within Hawkbit. The request body must always be a list of types. Required Permission: CREATE_REPOSITORY === Create distribution set types @@ -114,7 +114,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for a single distribution set type within SP. Required Permission: DELETE_REPOSITORY +Handles the DELETE request for a single distribution set type within Hawkbit. Required Permission: DELETE_REPOSITORY === Delete distribution set type @@ -157,7 +157,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the GET request of retrieving a single distribution set type within SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving a single distribution set type within Hawkbit. Required Permission: READ_REPOSITORY === Get distribution set type @@ -203,7 +203,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the PUT request for a single distribution set type within SP. Required Permission: UPDATE_REPOSITORY +Handles the PUT request for a single distribution set type within Hawkbit. Required Permission: UPDATE_REPOSITORY === Update distribution set type @@ -354,7 +354,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for removing a software module type from a single distribution set type within SP. Required Permission: DELETE_REPOSITORY +Handles the DELETE request for removing a software module type from a single distribution set type within Hawkbit. Required Permission: DELETE_REPOSITORY Delete mandatory software module type. @@ -541,8 +541,6 @@ include::../errors/429.adoc[] == DELETE /rest/v1/distributionsettypes/{distributionSetTypeId}/optionalmoduletypes/{softwareModuleTypeId} -== DELETE /rest/v1/distributionsettypes/{distributionSetTypeId}/mandatorymoduletypes/{softwareModuleTypeId} - === Implementation Notes Handles DELETE request for removing an optional module from the distribution set type.Note that a DS type cannot be changed after it has been used by a DS. Required Permission: UPDATE_REPOSITORY and READ_REPOSITORY diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rollout-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rollout-api-guide.adoc index c3137bef5..0ed88de6e 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rollout-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rollout-api-guide.adoc @@ -18,7 +18,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all rollouts within SP. Required Permission: READ_ROLLOUT +Handles the GET request of retrieving all rollouts within Hawkbit. Required Permission: READ_ROLLOUT === Get paged list of Rollouts @@ -65,7 +65,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving a single rollout within SP. Required Permission: READ_ROLLOUT +Handles the GET request of retrieving a single rollout within Hawkbit. Required Permission: READ_ROLLOUT === Get Rollout @@ -108,7 +108,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts === Implementation Notes -Handles the POST request of creating new rollout within SP. Required Permission: CREATE_ROLLOUT +Handles the POST request of creating new rollout within Hawkbit. Required Permission: CREATE_ROLLOUT === Create Rollout with defined amount of groups @@ -182,7 +182,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts/{rolloutId}/approve === Implementation Notes -Handles the POST request of approving a created rollout within SP. +Handles the POST request of approving a created rollout within Hawkbit. Only possible if approval workflow is enabled in system configuration and rollout is in state WAITING_FOR_APPROVAL. Required Permission: APPROVE_ROLLOUT @@ -219,7 +219,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts/{rolloutId}/deny === Implementation Notes -Handles the POST request of denying a created rollout within SP. +Handles the POST request of denying a created rollout within Hawkbit. Only possible if approval workflow is enabled in system configuration and rollout is in state WAITING_FOR_APPROVAL. Required Permission: APPROVE_ROLLOUT @@ -257,7 +257,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts/{rolloutId}/start === Implementation Notes -Handles the POST request of starting a created rollout within SP. Required Permission: HANDLE_ROLLOUT +Handles the POST request of starting a created rollout within Hawkbit. Required Permission: HANDLE_ROLLOUT === Start Rollout @@ -293,7 +293,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts/{rolloutId}/pause === Implementation Notes -Handles the POST request of pausing a running rollout within SP. Required Permission: HANDLE_ROLLOUT +Handles the POST request of pausing a running rollout within Hawkbit. Required Permission: HANDLE_ROLLOUT === Pause Rollout @@ -326,7 +326,7 @@ include::../errors/429.adoc[] == POST /rest/v1/rollouts/{rolloutId}/resume === Implementation Notes -Handles the POST request of resuming a paused rollout within SP. Required Permission: HANDLE_ROLLOUT +Handles the POST request of resuming a paused rollout within Hawkbit. Required Permission: HANDLE_ROLLOUT === Resume Rollout @@ -360,7 +360,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request of deleting a rollout within SP. Required Permission: DELETE_ROLLOUT +Handles the DELETE request of deleting a rollout within Hawkbit. Required Permission: DELETE_ROLLOUT === Deleting a rollout @@ -400,7 +400,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving all deploy groups of a specific rollout within SP. Required Permission: READ_ROLLOUT +Handles the GET request of retrieving all deploy groups of a specific rollout within Hawkbit. Required Permission: READ_ROLLOUT === Get Deploy Groups @@ -452,7 +452,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of a single deploy group of a specific rollout within SP. Required Permission: READ_ROLLOUT +Handles the GET request of a single deploy group of a specific rollout within Hawkbit. Required Permission: READ_ROLLOUT === Get Deploy Groups @@ -496,7 +496,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving all targets of a single deploy group of a specific rollout within SP. Required Permissions: READ_ROLLOUT, READ_TARGET. +Handles the GET request of retrieving all targets of a single deploy group of a specific rollout within Hawkbit. Required Permissions: READ_ROLLOUT, READ_TARGET. === Get Deploy Group Targets diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rootcontroller-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rootcontroller-api-guide.adoc index 238a89fe6..e7f2b4ebb 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rootcontroller-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/rootcontroller-api-guide.adoc @@ -69,7 +69,7 @@ include::../errors/429.adoc[] === Implementation notes -The SP server might cancel an operation, e.g. an unfinished update has a sucessor. It is up to the provisiong target to decide to accept the cancelation or reject it. +The Hawkbit server might cancel an operation, e.g. an unfinished update has a sucessor. It is up to the provisiong target to decide to accept the cancelation or reject it. === Cancel an action diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremodules-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremodules-api-guide.adoc index d2ba5b382..002d3c1d6 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremodules-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremodules-api-guide.adoc @@ -15,7 +15,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all softwaremodules within SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving all softwaremodules within Hawkbit. Required Permission: READ_REPOSITORY === Get software modules @@ -63,7 +63,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the POST request of creating new software modules within SP. The request body must always be a list of modules. Required Permission: CREATE_REPOSITORY +Handles the POST request of creating new software modules within Hawkbit. The request body must always be a list of modules. Required Permission: CREATE_REPOSITORY === Create software modules @@ -112,7 +112,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for a single softwaremodule within SP. Required Permission: DELETE_REPOSITORY +Handles the DELETE request for a single softwaremodule within Hawkbit. Required Permission: DELETE_REPOSITORY === Delete software module @@ -155,7 +155,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the GET request of retrieving a single softwaremodule within SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving a single softwaremodule within Hawkbit. Required Permission: READ_REPOSITORY === Get software module @@ -202,7 +202,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the PUT request for a single softwaremodule within SP. Required Permission: UPDATE_REPOSITORY +Handles the PUT request for a single softwaremodule within Hawkbit. Required Permission: UPDATE_REPOSITORY === Update software module @@ -358,7 +358,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for a single SoftwareModule within SP. Required Permission: DELETE_REPOSITORY +Handles the DELETE request for a single SoftwareModule within Hawkbit. Required Permission: DELETE_REPOSITORY === Delete arifact diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremoduletypes-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremoduletypes-api-guide.adoc index 075ebd546..97249b5a3 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremoduletypes-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/softwaremoduletypes-api-guide.adoc @@ -15,7 +15,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all software module types within SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving all software module types within Hawkbit. Required Permission: READ_REPOSITORY === Get software module types @@ -63,7 +63,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the POST request of creating new software module types within SP. The request body must always be a list of module types. Required Permission: CREATE_REPOSITORY +Handles the POST request of creating new software module types within Hawkbit. The request body must always be a list of module types. Required Permission: CREATE_REPOSITORY === Creating software module types @@ -112,7 +112,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request for a single software module type within SP. Required Permission: DELETE_REPOSITORY +Handles the DELETE request for a single software module type within Hawkbit. Required Permission: DELETE_REPOSITORY === Delete software module type @@ -153,7 +153,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the GET request of retrieving a single software module type within SP. Required Permission: READ_REPOSITORY +Handles the GET request of retrieving a single software module type within Hawkbit. Required Permission: READ_REPOSITORY === Accessing a software module type @@ -197,7 +197,7 @@ include::../errors/429.adoc[] === Implementation notes -Handles the PUT request for a single software module type within SP. Required Permission: UPDATE_REPOSITORY +Handles the PUT request for a single software module type within Hawkbit. Required Permission: UPDATE_REPOSITORY === Updating a software module types diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targetfilters-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targetfilters-api-guide.adoc index c97295376..2c4d48f14 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targetfilters-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targetfilters-api-guide.adoc @@ -16,7 +16,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all target filter queries within SP. Required permission: READ_TARGET +Handles the GET request of retrieving all target filter queries within Hawkbit. Required permission: READ_TARGET === Get paged list of target filter queries @@ -66,7 +66,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the POST request to create a new target filter query within SP. Required permission: CREATE_TARGET +Handles the POST request to create a new target filter query within Hawkbit. Required permission: CREATE_TARGET === Create a target filter query @@ -112,7 +112,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request of deleting a target filter query within SP. Required permission: DELETE_TARGET +Handles the DELETE request of deleting a target filter query within Hawkbit. Required permission: DELETE_TARGET === Deleting a target @@ -153,7 +153,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving a single target filter query within SP. Required permission: READ_TARGET +Handles the GET request of retrieving a single target filter query within Hawkbit. Required permission: READ_TARGET === Get single target @@ -198,7 +198,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the PUT request of updating a target filter query within SP. Required permission: UPDATE_TARGET +Handles the PUT request of updating a target filter query within Hawkbit. Required permission: UPDATE_TARGET === Update a target diff --git a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targets-api-guide.adoc b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targets-api-guide.adoc index 81a3b3937..81a36a69b 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targets-api-guide.adoc +++ b/hawkbit-rest/hawkbit-rest-docs/src/main/asciidoc/targets-api-guide.adoc @@ -16,7 +16,7 @@ toc::[] === Implementation notes -Handles the GET request of retrieving all targets within SP. Required permission: READ_TARGET +Handles the GET request of retrieving all targets within Hawkbit. Required permission: READ_TARGET === Get paged list of targets @@ -66,7 +66,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the POST request of creating new targets within SP. The request body must always be a list of targets. Required Permission: CREATE_TARGET +Handles the POST request of creating new targets within Hawkbit. The request body must always be a list of targets. Required Permission: CREATE_TARGET === Create list of targets @@ -112,7 +112,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the DELETE request of deleting a single target within SP. Required Permission: DELETE_TARGET +Handles the DELETE request of deleting a single target within Hawkbit. Required Permission: DELETE_TARGET === Deleting a target @@ -153,7 +153,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the GET request of retrieving a single target within SP. Required Permission: READ_TARGET +Handles the GET request of retrieving a single target within Hawkbit. Required Permission: READ_TARGET === Get single target @@ -198,7 +198,7 @@ include::../errors/429.adoc[] === Implementation Notes -Handles the PUT request of updating a target within SP. Required Permission: UPDATE_TARGET +Handles the PUT request of updating a target within Hawkbit. Required Permission: UPDATE_TARGET === Update a target diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/ApiModelPropertiesGeneric.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/ApiModelPropertiesGeneric.java index 869f4af96..3420e066f 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/ApiModelPropertiesGeneric.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/ApiModelPropertiesGeneric.java @@ -19,7 +19,7 @@ public final class ApiModelPropertiesGeneric { public static final String ITEM_ID = "The technical identifier " + ENDING; public static final String NAME = "The name" + ENDING; public static final String DESCRPTION = "The description" + ENDING; - public static final String COLOUR = "The colour" + ENDING + ". In HEX format, e.g. #800080"; + public static final String COLOUR = "The colour" + ENDING; public static final String DELETED = "Deleted flag, used for soft deleted entities"; public static final String CREATED_BY = "Entity was originally created by (User, AMQP-Controller, anonymous etc.)"; diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/DistributionSetTypesDocumentationTest.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/DistributionSetTypesDocumentationTest.java index ad3e5ff73..d17f7a673 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/DistributionSetTypesDocumentationTest.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/DistributionSetTypesDocumentationTest.java @@ -84,6 +84,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume fieldWithPath("content[].lastModifiedBy") .description(ApiModelPropertiesGeneric.LAST_MODIFIED_BY).type("String"), fieldWithPath("content[].name").description(ApiModelPropertiesGeneric.NAME), + fieldWithPath("content[].deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("content[]._links.self").ignored()))); } @@ -91,8 +92,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume @Description("Handles the GET request of retrieving all distribution set types within SP with a defined page size and offset, sortet by name in descending order and filtered down to all targets which name starts with 'a'. Required Permission: READ_REPOSITORY.") public void getDistributionSetTypesWithParameters() throws Exception { - distributionSetTypeManagement.update(entityFactory.distributionSetType() - .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234")); + distributionSetTypeManagement.update( + entityFactory.distributionSetType().update(testdataFactory.createDistributionSet().getType().getId()) + .description("Desc1234").colour("rgb(86,37,99)")); mockMvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING).accept(MediaType.APPLICATION_JSON) .param("offset", "1").param("limit", "2").param("sort", "name:DESC").param("q", "name==a*")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) @@ -110,7 +112,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume final List types = new ArrayList<>(); types.add(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") - .mandatory(osType).optional(runtimeType).build()); + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType).build()); mockMvc.perform(post(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) .content(JsonBuilder.distributionSetTypesCreateValidFieldsOnly(types)) @@ -122,15 +124,16 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume requestFieldWithPath("[]name").description(ApiModelPropertiesGeneric.NAME), optionalRequestFieldWithPath("[]description") .description(ApiModelPropertiesGeneric.DESCRPTION), + optionalRequestFieldWithPath("[]colour") + .description(ApiModelPropertiesGeneric.COLOUR), optionalRequestFieldWithPath("[]mandatorymodules") .description(MgmtApiModelProperties.DS_TYPE_MANDATORY_MODULES), optionalRequestFieldWithPath("[]optionalmodules") .description(MgmtApiModelProperties.DS_TYPE_OPTIONAL_MODULES)), responseFields( - fieldWithPath("[]createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("[]createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), - fieldWithPath("[].description") + fieldWithPath("[]description") .description(ApiModelPropertiesGeneric.DESCRPTION), fieldWithPath("[]key").description(MgmtApiModelProperties.DS_TYPE_KEY), fieldWithPath("[]id").description(ApiModelPropertiesGeneric.ITEM_ID), @@ -140,14 +143,17 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume .description(ApiModelPropertiesGeneric.LAST_MODIFIED_BY).type("String"), fieldWithPath("[]name").description(ApiModelPropertiesGeneric.NAME), fieldWithPath("[]deleted").description(ApiModelPropertiesGeneric.DELETED), + fieldWithPath("[]colour") + .description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("[]_links.self").ignored()))); } @Test @Description("Handles the GET request of retrieving a single distribution set type within SP. Required Permission: READ_REPOSITORY") public void deleteDistributionSetType() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.update(entityFactory.distributionSetType() - .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234")); + final DistributionSetType testType = distributionSetTypeManagement.update( + entityFactory.distributionSetType().update(testdataFactory.createDistributionSet().getType().getId()) + .description("Desc1234").colour("rgb(86,37,99)")); mockMvc.perform(delete(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}", testType.getId())).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) @@ -160,7 +166,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume public void getDistributionSetType() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.update(entityFactory.distributionSetType() - .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234")); + .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234").colour("rgb(86,37,99)")); mockMvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}", testType.getId()).accept(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) @@ -179,6 +185,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume .type("String"), fieldWithPath("name").description(ApiModelPropertiesGeneric.NAME), fieldWithPath("deleted").description(ApiModelPropertiesGeneric.DELETED), + fieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("_links.self").ignored(), fieldWithPath("_links.mandatorymodules") .description(MgmtApiModelProperties.LINK_TO_MANDATORY_SMT), @@ -206,7 +213,8 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume public void putDistributionSetType() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.update(entityFactory.distributionSetType() .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234")); - final String body = new JSONObject().put("description", "an updated desription").toString(); + final String body = new JSONObject().put("description", "an updated description") + .put("colour", "rgb(106,178,83)").toString(); this.mockMvc .perform(put(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}", @@ -216,7 +224,8 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume pathParameters(parameterWithName("distributionSetTypeId") .description(ApiModelPropertiesGeneric.ITEM_ID)), requestFields( - requestFieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION)), + optionalRequestFieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION), + optionalRequestFieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR)), responseFields(fieldWithPath("createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION), @@ -228,6 +237,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume .type("String"), fieldWithPath("name").description(ApiModelPropertiesGeneric.NAME), fieldWithPath("deleted").description(ApiModelPropertiesGeneric.DELETED), + fieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("_links.self").ignored(), fieldWithPath("_links.mandatorymodules") .description(MgmtApiModelProperties.LINK_TO_MANDATORY_SMT), @@ -240,8 +250,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume @WithUser(principal = "uploadTester", allSpPermissions = true) @Description("Handles the GET request of retrieving the list of mandatory software module types in that distribution set type. Required Permission: READ_REPOSITORY.") public void getMandatoryModules() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(runtimeType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType)); mockMvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/mandatorymoduletypes", testType.getId()).accept(MediaType.APPLICATION_JSON)) @@ -273,8 +284,8 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume + "Note that a DS type cannot be changed after it has been used by a DS. Required Permission: " + SpPermission.UPDATE_REPOSITORY + " and " + SpPermission.READ_REPOSITORY) public void postMandatoryModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create( - entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1")); + final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() + .create().key("test1").name("TestName1").description("Desc1").colour("rgb(86,37,99)")); mockMvc.perform(post(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/mandatorymoduletypes", testType.getId()) @@ -291,8 +302,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume + "Note that a DS type cannot be changed after it has been used by a DS. Required permissions: " + SpPermission.UPDATE_REPOSITORY + " and " + SpPermission.READ_REPOSITORY) public void deleteMandatoryModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(runtimeType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType)); mockMvc.perform(delete( MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/mandatorymoduletypes/{softwareModuleTypeId}", @@ -308,8 +320,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume @Description("Handles the GET request of retrieving the single mandatory software module type in that distribution set type. Required Permission: " + SpPermission.READ_REPOSITORY) public void getMandatoryModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(runtimeType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType)); mockMvc.perform(get( MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING @@ -338,8 +351,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume @Description("Handles the GET request of retrieving the list of optional software module types in that distribution set type. Required Permission: " + SpPermission.READ_REPOSITORY) public void getOptionalModules() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(runtimeType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType)); mockMvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/optionalmoduletypes", testType.getId()).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) @@ -350,6 +364,7 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume responseFields(fieldWithPath("[]createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("[]createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("[]description").description(ApiModelPropertiesGeneric.DESCRPTION), + fieldWithPath("[]colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("[]key").description(MgmtApiModelProperties.SM_TYPE_KEY), fieldWithPath("[]maxAssignments") .description(MgmtApiModelProperties.SMT_MAX_ASSIGNMENTS), @@ -368,8 +383,8 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume + "Note that a DS type cannot be changed after it has been used by a DS. Required Permission: " + SpPermission.UPDATE_REPOSITORY + " and " + SpPermission.READ_REPOSITORY) public void postOptionalModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create( - entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1")); + final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() + .create().key("test1").name("TestName1").description("Desc1").colour("rgb(86,37,99)")); mockMvc.perform(post(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/optionalmoduletypes", testType.getId()) .content("{\"id\":" + appType.getId() + "}").contentType(MediaType.APPLICATION_JSON)) @@ -386,8 +401,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume + "Note that a DS type cannot be changed after it has been used by a DS. Required Permission: " + SpPermission.UPDATE_REPOSITORY + " and " + SpPermission.READ_REPOSITORY) public void deleteOptionalModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(runtimeType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(runtimeType)); mockMvc.perform(delete( MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "/{distributionSetTypeId}/optionalmoduletypes/{softwareModuleTypeId}", @@ -402,8 +418,9 @@ public class DistributionSetTypesDocumentationTest extends AbstractApiRestDocume @Description("Handles the GET request of retrieving the single optional software module type in that distribution set type. Required Permission: " + SpPermission.READ_REPOSITORY) public void getOptionalModule() throws Exception { - final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() - .create().key("test1").name("TestName1").description("Desc1").mandatory(osType).optional(appType)); + final DistributionSetType testType = distributionSetTypeManagement + .create(entityFactory.distributionSetType().create().key("test1").name("TestName1").description("Desc1") + .colour("rgb(86,37,99)").mandatory(osType).optional(appType)); mockMvc.perform(get( MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremoduleTypesDocumentationTest.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremoduleTypesDocumentationTest.java index a58246f8f..ed1ca1092 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremoduleTypesDocumentationTest.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremoduleTypesDocumentationTest.java @@ -58,7 +58,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen final SoftwareModuleType testType = testdataFactory.findOrCreateSoftwareModuleType("test123"); softwareModuleTypeManagement - .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234")); + .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234").colour("rgb(106,178,83)")); mockMvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) @@ -75,6 +75,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen fieldWithPath("content[].lastModifiedBy") .description(ApiModelPropertiesGeneric.LAST_MODIFIED_BY).type("String"), fieldWithPath("content[].name").description(ApiModelPropertiesGeneric.NAME), + fieldWithPath("content[].deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("content[]._links.self").ignored()))); } @@ -84,7 +85,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen public void getSoftwareModuleTypesWithParameters() throws Exception { final SoftwareModuleType testType = testdataFactory.findOrCreateSoftwareModuleType("test123"); softwareModuleTypeManagement - .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234")); + .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234").colour("rgb(106,178,83)")); mockMvc.perform(get( MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==a") @@ -100,7 +101,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen public void postSoftwareModuleTypes() throws Exception { final List types = Arrays.asList(entityFactory.softwareModuleType().create().key("test1") - .name("TestName1").description("Desc1").build()); + .name("TestName1").description("Desc1").colour("rgb(106,178,83)").build()); this.mockMvc .perform(post(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) @@ -109,18 +110,19 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen .andDo(MockMvcResultPrinter.print()) .andDo(this.document.document( requestFields( + requestFieldWithPath("[]key").description(MgmtApiModelProperties.SMT_KEY), + requestFieldWithPath("[]name").description(ApiModelPropertiesGeneric.NAME), + requestFieldWithPath("[]maxAssignments").description(MgmtApiModelProperties.SM_MAX_ASSIGNMENTS), optionalRequestFieldWithPath("[]description") .description(ApiModelPropertiesGeneric.DESCRPTION), - optionalRequestFieldWithPath("[]key").description(MgmtApiModelProperties.SMT_KEY), - optionalRequestFieldWithPath("[]maxAssignments") - .description(MgmtApiModelProperties.SM_MAX_ASSIGNMENTS), - requestFieldWithPath("[]name").description(ApiModelPropertiesGeneric.NAME)), + optionalRequestFieldWithPath("[]colour").description(ApiModelPropertiesGeneric.COLOUR)), responseFields(fieldWithPath("[]key").description(MgmtApiModelProperties.SMT_KEY), fieldWithPath("[]maxAssignments") .description(MgmtApiModelProperties.SMT_MAX_ASSIGNMENTS), fieldWithPath("[]createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("[]createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("[]description").description(ApiModelPropertiesGeneric.DESCRPTION), + fieldWithPath("[]colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("[]deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("[]id").description(ApiModelPropertiesGeneric.ITEM_ID), fieldWithPath("[]lastModifiedAt") @@ -138,7 +140,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen @Description("Handles the DELETE request for a single software module Type within SP. Required Permission: DELETE_REPOSITORY.") public void deleteSoftwareModuleType() throws Exception { final SoftwareModuleType testType = softwareModuleTypeManagement.create( - entityFactory.softwareModuleType().create().key("test1").name("TestName1").description("Desc1")); + entityFactory.softwareModuleType().create().key("test1").name("TestName1").description("Desc1").colour("rgb(106,178,83)")); assertThat(softwareModuleTypeManagement.count()).isEqualTo(4); this.mockMvc .perform(delete(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeID}", @@ -155,7 +157,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen public void getSoftwareModuleType() throws Exception { final SoftwareModuleType testType = testdataFactory.findOrCreateSoftwareModuleType("test123"); softwareModuleTypeManagement - .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234")); + .update(entityFactory.softwareModuleType().update(testType.getId()).description("Desc1234").colour("rgb(106,178,83)")); this.mockMvc .perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeID}", @@ -169,6 +171,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen fieldWithPath("createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION), + fieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("id").description(ApiModelPropertiesGeneric.ITEM_ID), fieldWithPath("lastModifiedAt").description(ApiModelPropertiesGeneric.LAST_MODIFIED_AT) @@ -185,7 +188,7 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen public void putSoftwareModuleType() throws Exception { final SoftwareModuleType testType = testdataFactory.findOrCreateSoftwareModuleType("test123"); - final String body = new JSONObject().put("description", "a new description").toString(); + final String body = new JSONObject().put("description", "a new description").put("colour", "rgb(86,37,99)").toString(); this.mockMvc .perform(put(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING + "/{softwareModuleTypeID}", @@ -195,12 +198,14 @@ public class SoftwaremoduleTypesDocumentationTest extends AbstractApiRestDocumen pathParameters(parameterWithName("softwareModuleTypeID") .description(ApiModelPropertiesGeneric.ITEM_ID)), requestFields( - requestFieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION)), + optionalRequestFieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION), + optionalRequestFieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR)), responseFields(fieldWithPath("key").description(MgmtApiModelProperties.SMT_KEY), fieldWithPath("maxAssignments").description(MgmtApiModelProperties.SMT_MAX_ASSIGNMENTS), fieldWithPath("createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("description").description(ApiModelPropertiesGeneric.DESCRPTION), + fieldWithPath("colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("id").description(ApiModelPropertiesGeneric.ITEM_ID), fieldWithPath("lastModifiedAt").description(ApiModelPropertiesGeneric.LAST_MODIFIED_AT) diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/TargetTypesDocumentationTest.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/TargetTypesDocumentationTest.java index 053ed29b3..15b8210a1 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/TargetTypesDocumentationTest.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/TargetTypesDocumentationTest.java @@ -218,6 +218,7 @@ public class TargetTypesDocumentationTest extends AbstractApiRestDocumentation { fieldWithPath("[]key").description(MgmtApiModelProperties.DS_TYPE_KEY), fieldWithPath("[]name").description(ApiModelPropertiesGeneric.NAME), fieldWithPath("[]description").description(ApiModelPropertiesGeneric.DESCRPTION), + fieldWithPath("[]colour").description(ApiModelPropertiesGeneric.COLOUR), fieldWithPath("[]createdAt").description(ApiModelPropertiesGeneric.CREATED_AT), fieldWithPath("[]createdBy").description(ApiModelPropertiesGeneric.CREATED_BY), fieldWithPath("[]lastModifiedAt") @@ -226,7 +227,6 @@ public class TargetTypesDocumentationTest extends AbstractApiRestDocumentation { .description(ApiModelPropertiesGeneric.LAST_MODIFIED_BY).type("String"), fieldWithPath("[]deleted").description(ApiModelPropertiesGeneric.DELETED), fieldWithPath("[]_links.self").ignored()))); - } @Test @@ -268,6 +268,6 @@ public class TargetTypesDocumentationTest extends AbstractApiRestDocumentation { .andDo(this.document.document(pathParameters( parameterWithName("targetTypeId").description(ApiModelPropertiesGeneric.ITEM_ID), parameterWithName("distributionSetTypeId").description(ApiModelPropertiesGeneric.ITEM_ID)))); - } + }