-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1895 from siemens/fix/summaryandadministrativeInfo
fix(rest): Added endpoint url for summary and administration page info Reviewed by: [email protected] Tested by: [email protected]
- Loading branch information
Showing
4 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,6 +218,7 @@ public void before() throws TException, IOException { | |
project.setSpecialRisksOSS("Lorem Ipsum"); | ||
project.setGeneralRisks3rdParty("Lorem Ipsum"); | ||
project.setSpecialRisks3rdParty("Lorem Ipsum"); | ||
project.setLicenseInfoHeaderText("Lorem Ipsum"); | ||
project.setDeliveryChannels("Lorem Ipsum"); | ||
project.setVendor(new Vendor()); | ||
project.setRemarksAdditionalRequirements("Lorem Ipsum"); | ||
|
@@ -232,6 +233,10 @@ public void before() throws TException, IOException { | |
project.setAdditionalData(additionalData); | ||
project.setPhaseOutSince("2020-06-24"); | ||
project.setClearingRequestId("CR-1"); | ||
Map<String, String> externalURLs1 = new HashMap<>(); | ||
externalURLs1.put("homepage", "http://test_wiki_url.com"); | ||
externalURLs1.put("wiki", "http://test_wiki_url.com"); | ||
project.setExternalUrls(externalURLs1); | ||
|
||
projectListByName.add(project); | ||
projectList.add(project); | ||
|
@@ -266,6 +271,7 @@ public void before() throws TException, IOException { | |
project2.setSpecialRisks3rdParty("Lorem Ipsum"); | ||
project2.setDeliveryChannels("Lorem Ipsum"); | ||
project2.setRemarksAdditionalRequirements("Lorem Ipsum"); | ||
project2.setLicenseInfoHeaderText("Lorem Ipsum"); | ||
project2.setVendor(new Vendor()); | ||
project2.setSecurityResponsibles(new HashSet<>(Arrays.asList("[email protected]", "[email protected]"))); | ||
project2.setProjectResponsible("[email protected]"); | ||
|
@@ -678,6 +684,8 @@ public void should_document_get_projects_with_all_details() throws Exception { | |
subsectionWithPath("_embedded.sw360:projects.[]_embedded.clearingTeam").description("The clearingTeam of the project").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]_embedded.homepage").description("The homepage url of the project").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]_embedded.wiki").description("The wiki url of the project").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]licenseInfoHeaderText").description("The licenseInfoHeaderText text of the project"), | ||
subsectionWithPath("_embedded.sw360:projects.[]externalUrls").description("A place to store additional data used by external tools").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]_embedded.sw360:moderators").description("An array of all project moderators with email").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]_embedded.sw360:contributors").description("An array of all project contributors with email").optional(), | ||
subsectionWithPath("_embedded.sw360:projects.[]_embedded.sw360:attachments").description("An array of all project attachments").optional(), | ||
|
@@ -737,6 +745,8 @@ public void should_document_get_project() throws Exception { | |
fieldWithPath("enableVulnerabilitiesDisplay").description("Displaying vulnerabilities flag."), | ||
fieldWithPath("state").description("The project active status, possible values are: " + Arrays.asList(ProjectState.values())), | ||
fieldWithPath("phaseOutSince").description("The project phase-out date"), | ||
fieldWithPath("licenseInfoHeaderText").description("The licenseInfoHeaderText text of the project"), | ||
subsectionWithPath("externalUrls").description("A place to store additional data used by external URLs"), | ||
fieldWithPath("clearingRequestId").description("Clearing Request id associated with project."), | ||
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"), | ||
subsectionWithPath("_embedded.createdBy").description("The user who created this project"), | ||
|
@@ -1438,6 +1448,8 @@ public void should_document_update_project() throws Exception { | |
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources"), | ||
subsectionWithPath("_embedded.createdBy").description("The user who created this project"), | ||
fieldWithPath("enableSvm").description("Security vulnerability monitoring flag"), | ||
fieldWithPath("licenseInfoHeaderText").description("The licenseInfoHeaderText text of the project"), | ||
subsectionWithPath("externalUrls").description("A place to store additional data used by external URLs"), | ||
fieldWithPath("considerReleasesFromExternalList").description("Consider list of releases from existing external list"), | ||
fieldWithPath("enableVulnerabilitiesDisplay").description("Displaying vulnerabilities flag."), | ||
subsectionWithPath("_embedded.sw360:moderators").description("An array of moderators"), | ||
|
@@ -1681,4 +1693,55 @@ public void should_document_get_project_count() throws Exception { | |
fieldWithPath("count").description("Count of projects for a user.").optional() | ||
))); | ||
} | ||
@Test | ||
public void should_document_create_summary_administration() throws Exception { | ||
String accessToken = TestHelper.getAccessToken(mockMvc, testUserId, testUserPassword); | ||
mockMvc.perform(get("/api/projects/" + project.getId()+ "/summaryAdministration") | ||
.header("Authorization", "Bearer " + accessToken) | ||
.accept(MediaTypes.HAL_JSON)) | ||
.andExpect(status().isOk()) | ||
.andDo(this.documentationHandler.document( | ||
responseFields( | ||
fieldWithPath("name").description("The name of the project"), | ||
fieldWithPath("version").description("The project version"), | ||
fieldWithPath("createdOn").description("The date the project was created"), | ||
fieldWithPath("projectType").description("The project type, possible values are: " + Arrays.asList(ProjectType.values())), | ||
fieldWithPath("domain").description("The domain, possible values are:" + Sw360ResourceServer.DOMAIN.toString()), | ||
fieldWithPath("visibility").description("The project visibility, possible values are: " + Arrays.asList(Visibility.values())), | ||
subsectionWithPath("externalIds").description("When projects are imported from other tools, the external ids can be stored here. Store as 'Single String' when single value, or 'Array of String' when multi-values"), | ||
subsectionWithPath("additionalData").description("A place to store additional data used by external tools"), | ||
fieldWithPath("ownerAccountingUnit").description("The owner accounting unit of the project"), | ||
fieldWithPath("ownerGroup").description("The owner group of the project"), | ||
fieldWithPath("description").description("The project description"), | ||
fieldWithPath("ownerCountry").description("The owner country of the project"), | ||
fieldWithPath("obligationsText").description("The obligations text of the project"), | ||
fieldWithPath("clearingSummary").description("The clearing summary text of the project"), | ||
fieldWithPath("specialRisksOSS").description("The special risks OSS text of the project"), | ||
fieldWithPath("generalRisks3rdParty").description("The general risks 3rd party text of the project"), | ||
fieldWithPath("specialRisks3rdParty").description("The special risks 3rd party text of the project"), | ||
fieldWithPath("deliveryChannels").description("The sales and delivery channels text of the project"), | ||
fieldWithPath("remarksAdditionalRequirements").description("The remark additional requirements text of the project"), | ||
fieldWithPath("tag").description("The project tag"), | ||
fieldWithPath("businessUnit").description("The business unit this project belongs to"), | ||
fieldWithPath("deliveryStart").description("The project delivery start date"), | ||
fieldWithPath("preevaluationDeadline").description("The project preevaluation deadline"), | ||
fieldWithPath("systemTestStart").description("Date of the project system begin phase"), | ||
fieldWithPath("systemTestEnd").description("Date of the project system end phase"), | ||
fieldWithPath("securityResponsibles").description("An array of users responsible for security of the project."), | ||
fieldWithPath("projectResponsible").description("A user who is responsible for the project."), | ||
fieldWithPath("enableSvm").description("Security vulnerability monitoring flag"), | ||
fieldWithPath("considerReleasesFromExternalList").description("Consider list of releases from existing external list"), | ||
fieldWithPath("enableVulnerabilitiesDisplay").description("Displaying vulnerabilities flag."), | ||
fieldWithPath("state").description("The project active status, possible values are: " + Arrays.asList(ProjectState.values())), | ||
fieldWithPath("phaseOutSince").description("The project phase-out date"), | ||
fieldWithPath("clearingRequestId").description("Clearing Request id associated with project."), | ||
fieldWithPath("licenseInfoHeaderText").description("Display licenseInfoHeaderText info"), | ||
subsectionWithPath("externalUrls").description("A place to store additional data used by external URLs"), | ||
subsectionWithPath("_embedded.createdBy").description("The user who created this project"), | ||
subsectionWithPath("_embedded.sw360:moderators").description("An array of moderators"), | ||
subsectionWithPath("_embedded.sw360:vendors").description("An array of all component vendors with full name and link to their <<resources-vendor-get,Vendor resource>>"), | ||
subsectionWithPath("_embedded.sw360:attachments").description("An array of all project attachments and link to their <<resources-attachment-get,Attachment resource>>"), | ||
subsectionWithPath("_links").description("<<resources-index-links,Links>> to other resources") | ||
))); | ||
} | ||
} |