Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
dev(rest): add missing rest properties for components and projects
Browse files Browse the repository at this point in the history
  • Loading branch information
maierthomas committed Apr 3, 2018
1 parent c098fc3 commit ff70154
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,12 @@ public Sw360Module() {
"attachments",
"createdBy",
"state",
"tag",
"projectResponsible",
"leadArchitect",
"moderators",
"contributors",
"visbility",
"clearingTeam",
"preevaluationDeadline",
"systemTestStart",
"systemTestEnd",
"phaseOutSince",
"homepage",
"wiki",
Expand Down Expand Up @@ -213,10 +209,7 @@ static abstract class UserMixin extends User {
"moderators",
"releases",
"mainLicenseIds",
"categories",
"languages",
"softwarePlatforms",
"operatingSystems",
"homepage",
"mailinglist",
"wiki",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
package org.eclipse.sw360.rest.resourceserver.restdocs;

import com.google.common.collect.ImmutableSet;
import org.apache.thrift.TException;
import org.eclipse.sw360.datahandler.thrift.components.Component;
import org.eclipse.sw360.datahandler.thrift.components.ComponentType;
Expand Down Expand Up @@ -72,6 +73,9 @@ public void before() throws TException {
angularComponent.setOwnerAccountingUnit("4822");
angularComponent.setOwnerCountry("DE");
angularComponent.setOwnerGroup("AA BB 123 GHV2-DE");
angularComponent.setCategories(ImmutableSet.of("java", "javascript", "sql"));
angularComponent.setLanguages(ImmutableSet.of("EN", "DE"));
angularComponent.setOperatingSystems(ImmutableSet.of("Windows", "Linux"));
componentList.add(angularComponent);
componentListByName.add(angularComponent);

Expand All @@ -88,6 +92,9 @@ public void before() throws TException {
springComponent.setOwnerAccountingUnit("5661");
springComponent.setOwnerCountry("FR");
springComponent.setOwnerGroup("SIM-KA12");
springComponent.setCategories(ImmutableSet.of("jdbc", "java"));
springComponent.setLanguages(ImmutableSet.of("EN", "DE"));
springComponent.setOperatingSystems(ImmutableSet.of("Windows", "Linux"));
componentList.add(springComponent);

when(this.componentServiceMock.createComponent(anyObject(), anyObject())).then(invocation -> {
Expand Down Expand Up @@ -177,6 +184,9 @@ public void should_document_get_component() throws Exception {
fieldWithPath("ownerAccountingUnit").description("The owner accounting unit of the component"),
fieldWithPath("ownerGroup").description("The owner group of the component"),
fieldWithPath("ownerCountry").description("The owner country of the component"),
fieldWithPath("categories").description("The component categories"),
fieldWithPath("languages").description("The language of the component"),
fieldWithPath("operatingSystems").description("The OS on which the component operates"),
fieldWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
fieldWithPath("_embedded.createdBy").description("The user who created this component"),
fieldWithPath("_embedded.sw360:releases").description("An array of all component releases with version and link to their <<resources-releases,Releases resource>>"),
Expand Down Expand Up @@ -217,6 +227,9 @@ public void should_document_create_component() throws Exception {
fieldWithPath("ownerAccountingUnit").description("The owner accounting unit of the component"),
fieldWithPath("ownerGroup").description("The owner group of the component"),
fieldWithPath("ownerCountry").description("The owner country of the component"),
fieldWithPath("categories").description("The component categories"),
fieldWithPath("languages").description("The language of the component"),
fieldWithPath("operatingSystems").description("The OS on which the component operates"),
fieldWithPath("_embedded.createdBy").description("The user who created this component"),
fieldWithPath("_links").description("<<resources-index-links,Links>> to other resources")
)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public void before() throws TException {
project.setOwnerAccountingUnit("4822");
project.setOwnerCountry("DE");
project.setOwnerGroup("AA BB 123 GHV2-DE");
project.setTag("project test tag 1");
project.setPreevaluationDeadline("2018-07-17");
project.setSystemTestStart("2017-01-01");
project.setSystemTestEnd("2018-03-01");
linkedReleases.put("3765276512", projectReleaseRelationship);
project.setReleaseIdToUsage(linkedReleases);
linkedProjects.put("376576", ProjectRelationship.CONTAINED);
Expand All @@ -106,6 +110,10 @@ public void before() throws TException {
project2.setOwnerAccountingUnit("5661");
project2.setOwnerCountry("FR");
project2.setOwnerGroup("SIM-KA12");
project2.setTag("project test tag 2");
project2.setPreevaluationDeadline("2018-07-17");
project2.setSystemTestStart("2017-01-01");
project2.setSystemTestEnd("2018-03-01");
project2.setExternalIds(Collections.singletonMap("mainline-id-project", "7657"));
linkedReleases = new HashMap<>();
linkedReleases.put("5578999", projectReleaseRelationship);
Expand Down Expand Up @@ -206,6 +214,10 @@ public void should_document_get_project() throws Exception {
fieldWithPath("ownerAccountingUnit").description("The owner accounting unit of the project"),
fieldWithPath("ownerGroup").description("The owner group of the project"),
fieldWithPath("ownerCountry").description("The owner country of the project"),
fieldWithPath("tag").description("The project tag"),
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("linkedProjects").description("The relationship between linked projects of the project"),
fieldWithPath("linkedReleases").description("The relationship between linked releases of the project"),
fieldWithPath("_links").description("<<resources-index-links,Links>> to other resources"),
Expand Down

0 comments on commit ff70154

Please sign in to comment.