Skip to content

Commit

Permalink
Resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
rladdusaw committed Sep 21, 2020
2 parents 657c321 + 616d2a2 commit 865936b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
14 changes: 5 additions & 9 deletions src/main/java/edu/tamu/app/ProjectInitialization.java
Expand Up @@ -2,8 +2,8 @@

import java.util.Arrays;
import java.util.HashSet;
import java.util.Optional;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Profile;
Expand All @@ -30,15 +30,11 @@ public class ProjectInitialization implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
remoteProjectManagerRepo.findAll().forEach(versionManagementSoftware -> {
if (Optional.ofNullable( versionManagementSoftware.getUrl()).isPresent()) {
return;
if (StringUtils.isNotEmpty(versionManagementSoftware.getUrl())) {
if (StringUtils.isNotEmpty(versionManagementSoftware.getToken())) {
managementBeanRegistry.register(versionManagementSoftware);
}
}

if (Optional.ofNullable( versionManagementSoftware.getToken()).isPresent()) {
return;
}

managementBeanRegistry.register(versionManagementSoftware);
});
CardType type = cardTypeRepo.findByIdentifier("Feature");
HashSet<String> featureTypes = new HashSet<String>(Arrays.asList(new String[] { "Story", "feature" }));
Expand Down
Expand Up @@ -76,11 +76,4 @@ public ApiResponse deleteRemoteProjectManager(@WeaverValidatedModel RemoteProjec
public ApiResponse getTypes() {
return new ApiResponse(SUCCESS, ServiceType.map());
}

@GetMapping("/scaffolding/{type}")
@PreAuthorize("hasRole('USER')")
public ApiResponse getTypeScaffolding(@PathVariable String type) {
ServiceType serviceType = ServiceType.valueOf(type);
return new ApiResponse(SUCCESS, serviceType.getScaffold());
}
}
22 changes: 0 additions & 22 deletions src/main/java/edu/tamu/app/model/ServiceType.java
Expand Up @@ -20,7 +20,6 @@ public enum ServiceType {
Map<String, Object> m = new HashMap<String, Object>();
m.put("value", type.toString());
m.put("gloss", type.gloss);
m.put("scaffold", type.getScaffold());
list.add(m);
}
}
Expand All @@ -37,27 +36,6 @@ public void setGloss(String gloss) {
this.gloss = gloss;
}

public List<Setting> getScaffold() {
List<Setting> scaffold = new ArrayList<Setting>();
switch (this) {
case GITHUB_MILESTONE:
case GITHUB_PROJECT:
scaffold.add(new Setting("text", "url", "URL", true));
scaffold.add(new Setting("password", "token", "Token", false));
break;
case VERSION_ONE:
scaffold.add(new Setting("text", "url", "URL", true));
scaffold.add(new Setting("text", "username", "Username", false));
scaffold.add(new Setting("password", "password", "Password", false));
scaffold.add(new Setting("password", "token", "Token", false));
break;
default:
break;

}
return scaffold;
}

public static List<Map<String, Object>> map() {
return list;
}
Expand Down
Expand Up @@ -136,10 +136,4 @@ public void testGetTypes() {
assertEquals("Not successful at getting service types", SUCCESS, response.getMeta().getStatus());
}

@Test
public void testGetScaffolding() {
ApiResponse response = remoteProjectManagerController.getTypeScaffolding(ServiceType.VERSION_ONE.toString());
assertEquals("Not successful at getting scaffolding", SUCCESS, response.getMeta().getStatus());
}

}

0 comments on commit 865936b

Please sign in to comment.