This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Resolve "Die Statistiken sollten auch in ElasticSearch hinterlegt werden."

Viewing commit e74b407a
Show latest version
1 file
+ 36
14
Compare changes
  • Side-by-side
  • Inline
@@ -139,8 +139,9 @@ class GitlabEventServiceTest {
String extreme_long_path = "0123456789".repeat(100);
ItemPath item_path3 = ges.new ItemPath(SlashPath.get(extreme_long_path + "Z", "metaData.yml"), commit, 10L);
assertEquals(
"[10]345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789Z",
item_path3.getDocId());
"[10]345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789Z",
item_path3.getDocId()
);
ItemPath item_path4 = ges.new ItemPath(SlashPath.get("/", "metaData.yml"), commit, 10L);
assertEquals("[10]", item_path4.getDocId());
@@ -149,24 +150,29 @@ class GitlabEventServiceTest {
@Test
void testPathParsing() throws ParseException {
String[] result = GitlabEventService.parseChildPath(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git[]loops/metadata.yaml");
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git[]loops/metadata.yaml"
);
String git_url = result[0];
String project_id = result[1];
String path = result[2];
assertEquals(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url);
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url
);
assertNull(project_id);
assertEquals("loops/metadata.yaml", path.toString());
result = GitlabEventService.parseChildPath(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git");
result =
GitlabEventService.parseChildPath(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git"
);
git_url = result[0];
project_id = result[1];
path = result[2];
assertEquals(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url);
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url
);
assertNull(project_id);
assertNull(path);
@@ -176,19 +182,35 @@ class GitlabEventServiceTest {
project_id = result[1];
path = result[2];
assertEquals(
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url);
"https://sharing.codeability-austria.uibk.ac.at/sharing/health-check-tests/collection_tests/collectionstests1.git",
git_url
);
assertNull(project_id);
assertNull(path);
url = "loops/metadata.yaml";
result = GitlabEventService.parseChildPath(url);
result = GitlabEventService.parseChildPath("loops/metadata.yaml");
git_url = result[0];
project_id = result[1];
path = result[2];
assertNull(git_url);
assertNull(project_id);
assertEquals("loops/metadata.yaml", path);
}
result = GitlabEventService.parseChildPath("[10]");
git_url = result[0];
project_id = result[1];
path = result[2];
assertNull(git_url);
assertEquals("10", project_id);
assertNull(path);
result = GitlabEventService.parseChildPath("[10]loops/metadata.yaml");
git_url = result[0];
project_id = result[1];
path = result[2];
assertNull(git_url);
assertEquals("10", project_id);
assertEquals("loops/metadata.yaml", path);
}
}