Fix default revision for hg and fix encoded slashes in URLs

This commit is contained in:
René Pfeuffer
2018-08-23 15:52:02 +02:00
parent 7177cbd3fe
commit ca563dd874
6 changed files with 66 additions and 24 deletions

View File

@@ -70,6 +70,8 @@ public class RepositoryAccessITCase {
@Test
public void shouldReadContent() throws IOException, InterruptedException {
repositoryUtil.createAndCommitFile("a.txt", "a");
tempFolder.newFolder("subfolder");
repositoryUtil.createAndCommitFile("subfolder/a.txt", "sub-a");
sleep(1000);
@@ -81,19 +83,40 @@ public class RepositoryAccessITCase {
.extract()
.path("_links.sources.href");
String contentUrl = given()
String rootContentUrl = given()
.when()
.get(sourcesUrl)
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
.path("files[0]._links.content.href");
.path("files.find{it.name=='a.txt'}._links.content.href");
given()
.when()
.get(contentUrl)
.get(rootContentUrl)
.then()
.statusCode(HttpStatus.SC_OK)
.body(equalTo("a"));
String subfolderSourceUrl = given()
.when()
.get(sourcesUrl)
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
.path("files.find{it.name=='subfolder'}._links.self.href");
String subfolderContentUrl= given()
.when()
.get(subfolderSourceUrl)
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
.path("files[0]._links.content.href");
System.out.println(subfolderContentUrl);
given()
.when()
.get(subfolderContentUrl)
.then()
.statusCode(HttpStatus.SC_OK)
.body(equalTo("sub-a"));
}
}