Skip to content

Commit

Permalink
chore(test): replaced LF with platform independent line separator for…
Browse files Browse the repository at this point in the history
… old test

Signed-off-by: l3002 <tanmaymathpal4545@gmail.com>
  • Loading branch information
l3002 committed Feb 29, 2024
1 parent e542872 commit d33e81e
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void withSuccessfulUpload_shouldUploadBlobsAndUpdateManifest() throws Exception
.resolve("Helm-Chart-1337-SNAPSHOT.tar.gz"),
"I'm a tar.gz, not a .tgz".getBytes(StandardCharsets.UTF_8));
Files.write(Paths.get(helmConfig.getOutputDir()).resolve("kubernetes").resolve("Chart.yaml"),
"---\napiVersion: v1\nname: test-chart\nversion: 0.0.1".getBytes(StandardCharsets.UTF_8));
String.format("---%napiVersion: v1%nname: test-chart%nversion: 0.0.1").getBytes(StandardCharsets.UTF_8));
mockServer.expect().post()
.withPath("/v2/test-chart/blobs/uploads/")
.andReply(new TestMockResponseProvider(202, singletonMap("Location", "/v2/test-chart/blobs/upload/first-upload-endpoint"), null))
Expand All @@ -471,19 +471,19 @@ void withSuccessfulUpload_shouldUploadBlobsAndUpdateManifest() throws Exception
helmService.uploadHelmChart(helmConfig);
// Then
assertThat(mockServer.getLastRequest().getBody().readUtf8())
.isEqualTo("{\n" +
" \"schemaVersion\" : 2,\n" +
" \"config\" : {\n" +
" \"mediaType\" : \"application/vnd.cncf.helm.config.v1+json\",\n" +
" \"digest\" : \"sha256:be0152670c8a31981ab17af598592ce91417c8be8700e708e4613739ec563031\",\n" +
" \"size\" : 73\n" +
" },\n" +
" \"layers\" : [ {\n" +
" \"mediaType\" : \"application/vnd.cncf.helm.chart.content.v1.tar+gzip\",\n" +
" \"digest\" : \"sha256:c7051faa2fb28d147b34070a6bce25eaf1ee6bb4ca3b47af5ee6148d50079154\",\n" +
" \"size\" : 24\n" +
" } ]\n" +
"}");
.isEqualTo(String.format("{%n" +
" \"schemaVersion\" : 2,%n" +
" \"config\" : {%n" +
" \"mediaType\" : \"application/vnd.cncf.helm.config.v1+json\",%n" +
" \"digest\" : \"sha256:be0152670c8a31981ab17af598592ce91417c8be8700e708e4613739ec563031\",%n" +
" \"size\" : 73%n" +
" },%n" +
" \"layers\" : [ {%n" +
" \"mediaType\" : \"application/vnd.cncf.helm.chart.content.v1.tar+gzip\",%n" +
" \"digest\" : \"sha256:c7051faa2fb28d147b34070a6bce25eaf1ee6bb4ca3b47af5ee6148d50079154\",%n" +
" \"size\" : 24%n" +
" } ]%n" +
"}"));
}
@Test
@DisplayName("On Windows, Sends chart metadata file, tarball and manifest file in separate requests")
Expand Down

0 comments on commit d33e81e

Please sign in to comment.