Skip to content

Commit 7739495

Browse files
committed
fix(rest) : Add licenseInfoHeaderText in summaryAdministration api response
1 parent 975e30f commit 7739495

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/project/ProjectController.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -2949,6 +2949,9 @@ public ResponseEntity<EntityModel<Project>> getAdministration(
29492949
) throws TException {
29502950
User sw360User = restControllerHelper.getSw360UserFromAuthentication();
29512951
Project sw360Project = projectService.getProjectForUserById(id, sw360User);
2952+
if(sw360Project.getLicenseInfoHeaderText().isEmpty()){
2953+
sw360Project.setLicenseInfoHeaderText(projectService.getLicenseInfoHeaderText());
2954+
}
29522955
Map<String, String> sortedExternalURLs = CommonUtils.getSortedMap(sw360Project.getExternalUrls(), true);
29532956
sw360Project.setExternalUrls(sortedExternalURLs);
29542957
sw360Project.setReleaseIdToUsage(null);
@@ -2961,7 +2964,6 @@ public ResponseEntity<EntityModel<Project>> getAdministration(
29612964
sw360Project.unsetReleaseIdToUsage();
29622965
sw360Project.unsetProjectResponsible();
29632966
sw360Project.unsetSecurityResponsibles();
2964-
sw360Project.unsetLicenseInfoHeaderText();
29652967

29662968
return new ResponseEntity<>(userHalResource, HttpStatus.OK);
29672969
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,7 @@ public void should_document_create_summary_administration() throws Exception {
24512451
fieldWithPath("state").description("The project active status, possible values are: " + Arrays.asList(ProjectState.values())),
24522452
fieldWithPath("phaseOutSince").description("The project phase-out date"),
24532453
fieldWithPath("clearingRequestId").description("Clearing Request id associated with project."),
2454+
fieldWithPath("licenseInfoHeaderText").description("LicenseInfoHeaderText associated with project."),
24542455
subsectionWithPath("externalUrls").description("A place to store additional data used by external URLs"),
24552456
subsectionWithPath("_embedded.createdBy").description("The user who created this project"),
24562457
subsectionWithPath("_embedded.projectResponsible").description("The project responsible displayed").type(JsonFieldType.OBJECT).optional(),

0 commit comments

Comments
 (0)