Skip to content

Commit fbea70a

Browse files
nikkuma7GMishx
authored andcommitted
fix(rest): Added packageIds in project create and update APIs.
Signed-off-by: Nikesh kumar <kumar.nikesh@siemens.com>
1 parent c1fbd1b commit fbea70a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/JacksonCustomizations.java

-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ static abstract class MultiStatusMixin extends MultiStatus {
323323
"packageIdsSize",
324324
"setPackageIds",
325325
"packageIdsIterator",
326-
"packageIds",
327326
"setReleaseRelationNetwork",
328327
"releaseRelationNetwork",
329328
"projectTypeIsSet",

rest/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/ProjectSpecTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public void before() throws TException, IOException {
258258
project.setCreatedOn("2016-12-15");
259259
project.setCreatedBy("admin@sw360.org");
260260
project.setModerators(new HashSet<>(Arrays.asList("admin@sw360.org", "jane@sw360.org")));
261+
project.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));
261262
project.setBusinessUnit("sw360 AR");
262263
project.setExternalIds(Collections.singletonMap("mainline-id-project", "515432"));
263264
project.setOwnerAccountingUnit("4822");
@@ -319,6 +320,7 @@ public void before() throws TException, IOException {
319320
project2.setProjectType(ProjectType.PRODUCT);
320321
project2.setDescription("Orange Web provides a suite of components for documentation.");
321322
project.setDomain("Hardware");
323+
project2.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));
322324
project2.setCreatedOn("2016-12-17");
323325
project2.setCreatedBy("john@sw360.org");
324326
project2.setBusinessUnit("sw360 EX DF");
@@ -376,6 +378,7 @@ public void before() throws TException, IOException {
376378
linkedProjects2.put("123456", new ProjectProjectRelationship(ProjectRelationship.CONTAINED).setEnableSvm(true));
377379
project4.setLinkedProjects(linkedProjects2);
378380
project4.setSecurityResponsibles(new HashSet<>(Arrays.asList("securityresponsible1@sw360.org", "securityresponsible2@sw360.org")));
381+
project4.setPackageIds(new HashSet<>(Arrays.asList("123456", "54844")));
379382

380383
Project project5 = new Project();
381384
project5.setId("123456");
@@ -877,6 +880,7 @@ public void should_document_get_projects() throws Exception {
877880
responseFields(
878881
subsectionWithPath("_embedded.sw360:projects.[]name").description("The name of the project"),
879882
subsectionWithPath("_embedded.sw360:projects.[]version").description("The project version"),
883+
//subsectionWithPath("_embedded.sw360:projects.[]packageIds").description("List of package IDs associated with the project"),
880884
subsectionWithPath("_embedded.sw360:projects.[]projectType").description("The project type, possible values are: " + Arrays.asList(ProjectType.values())),
881885
subsectionWithPath("_embedded.sw360:projects").description("An array of <<resources-projects, Projects resources>>"),
882886
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
@@ -1046,6 +1050,7 @@ public void should_document_get_projects_with_all_details() throws Exception {
10461050
subsectionWithPath("_embedded.sw360:projects.[]_embedded.sw360:attachments").description("An array of all project attachments").optional(),
10471051
subsectionWithPath("_embedded.sw360:projects.[]vendor").description("An array of all component vendors with full name and link to their <<resources-vendor-get,Vendor resource>>"),
10481052
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
1053+
subsectionWithPath("_embedded.sw360:projects[].packageIds").description("List of package IDs associated with each project."),
10491054
fieldWithPath("page").description("Additional paging information"),
10501055
fieldWithPath("page.size").description("Number of projects per page"),
10511056
fieldWithPath("page.totalElements").description("Total number of all existing projects"),
@@ -1068,6 +1073,7 @@ public void should_document_get_project() throws Exception {
10681073
fieldWithPath("id").description("The id of the project"),
10691074
fieldWithPath("name").description("The name of the project"),
10701075
fieldWithPath("version").description("The project version"),
1076+
fieldWithPath("packageIds").description("List of package IDs associated with the project."),
10711077
fieldWithPath("createdOn").description("The date the project was created"),
10721078
fieldWithPath("description").description("The project description"),
10731079
fieldWithPath("projectType").description("The project type, possible values are: " + Arrays.asList(ProjectType.values())),
@@ -1652,6 +1658,7 @@ public void should_document_update_project_vulnerabilities() throws Exception {
16521658
responseFields(
16531659
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]projectRelevance").description("The relevance of project of the vulnerability, possible values are: " + Arrays.asList(VulnerabilityRatingForProject.values())),
16541660
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]intReleaseId").description("The release id"),
1661+
// subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]packageIds").description("The list of package IDs linked to the vulnerability."),
16551662
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]comment").description("Any message to add while updating project vulnerabilities"),
16561663
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes.[]projectAction").description("The action of vulnerability"),
16571664
subsectionWithPath("_embedded.sw360:vulnerabilityDTOes").description("An array of <<resources-vulnerabilities, Vulnerability resources>>"),
@@ -2045,6 +2052,7 @@ public void should_document_update_project() throws Exception {
20452052
fieldWithPath("considerReleasesFromExternalList").description("Consider list of releases from existing external list"),
20462053
fieldWithPath("enableVulnerabilitiesDisplay").description("Displaying vulnerabilities flag."),
20472054
fieldWithPath("clearingState").description("The clearingState of the project"),
2055+
subsectionWithPath("packageIds").description("List of package IDs associated with the project"),
20482056
subsectionWithPath("_embedded.sw360:moderators").description("An array of moderators"),
20492057
subsectionWithPath("_embedded.sw360:projects").description("An array of <<resources-projects, Projects resources>>"),
20502058
subsectionWithPath("_embedded.sw360:releases").description("An array of <<resources-releases, Releases resources>>"),

0 commit comments

Comments
 (0)