Skip to content

Commit

Permalink
Merge branch 'releases/V2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurtom committed Nov 1, 2019
2 parents 2e08621 + 403f1d3 commit b9ad275
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.openreq</groupId>
<artifactId>Mallikas</artifactId>
<version>1.11</version>
<version>2.0.1</version>
<packaging>jar</packaging>

<name>Mallikas</name>
Expand Down Expand Up @@ -149,4 +149,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private String createUPCJsonString(List<Project> projects, List<Requirement> req
* @return
*/
public List<List<String>> splitRequirementIds(List<String> requirementIds) {
if (requirementIds.size()<=10000) {
if ((requirementIds==null) || (requirementIds.size() <= 10000)) {
return Arrays.asList(requirementIds);
}
List<List<String>> splitLists = new ArrayList<>();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/openreq/mallikas/services/UpdateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class UpdateService {

@Autowired
PersonRepository personRepository;

public ResponseEntity<String> importRequirements(Collection<Requirement> requirements) {
System.out.println("Received requirements from Milla");
List<Requirement> savedReqs = new ArrayList<>();
Expand Down Expand Up @@ -180,7 +180,7 @@ public ResponseEntity<String> updateProjectSpecifiedRequirements(Map<String, Col
/**
* Save dependencies received from similarity detection services and such
*
* @param dependencies
* @param dep
*/
private void saveDependency(Dependency dep) {
String depId = dep.getFromid() + "_" + dep.getToid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void setup() throws Exception {

RequirementPart part = new RequirementPart();
part.setId("part1");
part.setName("Resolution");
part.setText("Done");
testReq1.setRequirementParts(new HashSet<RequirementPart>(Arrays.asList(part)));

Expand All @@ -112,8 +113,12 @@ public void setup() throws Exception {
Requirement testReq2 = new Requirement();
testReq2.setId("req2");
testReq2.setCreated_at(1000000);

Requirement testReq3 = new Requirement();
testReq3.setId("req3");
testReq3.setRequirementParts(new HashSet<RequirementPart>(Arrays.asList(part)));

testReqs = Arrays.asList(testReq1, testReq2);
testReqs = Arrays.asList(testReq1, testReq2, testReq3);
testReqsJson = mapper.writeValueAsString(testReqs);

Dependency testDep1 = new Dependency();
Expand All @@ -130,20 +135,16 @@ public void setup() throws Exception {

Project testProj = new Project();
testProj.setId("pro1");
testProj.setSpecifiedRequirements(new HashSet<String>(Arrays.asList("req1", "req2")));
testProj.setSpecifiedRequirements(new HashSet<String>(Arrays.asList("req1", "req2, req3")));
testProJson = mapper.writeValueAsString(testProj);
testProjs = Arrays.asList(testProj);
testProjsJson = mapper.writeValueAsString(testProjs);

testReqIds = new HashMap<>();
testReqIds.put("pro1", Arrays.asList("req1", "req2"));
testReqIds.put("pro1", Arrays.asList("req1", "req2", "req3"));
testReqIdsJson = mapper.writeValueAsString(testReqIds);

ids = Arrays.asList("req1", "req2");

Requirement testReq3 = new Requirement();
testReq3.setId("req3");
testReq3.setRequirementParts(new HashSet<RequirementPart>(Arrays.asList(part)));
ids = Arrays.asList("req1", "req2", "req3");

mockMvc = MockMvcBuilders.standaloneSetup(controller).build();

Expand Down

0 comments on commit b9ad275

Please sign in to comment.