Skip to content

Commit

Permalink
fix: do not clone in Init
Browse files Browse the repository at this point in the history
  • Loading branch information
wurstbrot committed Jan 14, 2024
1 parent db05b01 commit 9e477af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ private void initiateApplications(boolean enforceGitCloneIfTargetFolderExists) t
}

private List<SkeletonActivity> getDeserializeSkeletons(boolean enforceGitCloneIfTargetFolderExists) throws IOException, GitAPIException {
logger.info("yamlConfigurationFilePath: " + yamlScanner.getSkeletonYaml(enforceGitCloneIfTargetFolderExists));

ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
yamlScanner.initiate(enforceGitCloneIfTargetFolderExists);
Map<?, ?> yamlActivityFileMap = YamlReader.convertYamlToJavaYaml(yamlScanner.getSkeletonYaml().getPath());
String skeletonString = mapper.writeValueAsString(yamlActivityFileMap.get("activity definitions"));
logger.info("skeletonString: " + skeletonString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,15 @@ public Collection<File> getApplicationYamls() throws IOException, GitAPIExceptio
.collect(Collectors.toList());
}
}
public File getSkeletonYaml(boolean enforceGitCloneIfTargetFolderExists) throws IOException, GitAPIException {
this.initiate(enforceGitCloneIfTargetFolderExists);
public File getSkeletonYaml() throws IOException, GitAPIException {
this.initiate(false);
logger.info("getYamlSkeletonFilePath() " + getYamlSkeletonFilePath());
File skeletonConfig = new File(getYamlSkeletonFilePath());
if (!skeletonConfig.exists()) throw new FileNotFoundException(getYamlSkeletonFilePath());

return skeletonConfig;
}

public File getSkeletonYaml() throws IOException, GitAPIException {
return getSkeletonYaml(false);
}

private boolean isGit(boolean enforceGitCloneIfTargetFolderExists) {
if (yamlGitUrl == null || yamlGitUrl.isEmpty()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void setUp() throws Exception {
constructor.setAccessible(true);
applicationDirector = constructor.newInstance();
YamlScanner yamlScanner = new YamlScanner();
yamlScanner.initiate(false);
setPrivateField(yamlScanner, "yamlApplicationFolderPath", "src/test/resources/test-security-requirements/definitions");
setPrivateField(yamlScanner, "yamlSkeletonFilePath", "src/test/resources/test-security-requirements/skeleton.yaml");
yamlScanner.getApplicationYamls();
Expand Down

0 comments on commit 9e477af

Please sign in to comment.