Skip to content

Commit

Permalink
Rename test method (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh authored Apr 1, 2021
1 parent 64317de commit ff8c5b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static String buildAndRun(
"-Djib.allowInsecureRegistries=" + imageReference.startsWith("localhost"),
"-b=" + gradleBuildFile);
assertBuildSuccess(buildResult, "jib", "Built and pushed image as ");
assertValidImageDigestAndIdOutputFiles(testProject.getProjectRoot());
assertThatExpectedImageDigestAndIdReturned(testProject.getProjectRoot());
MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(imageReference));

return pullAndRunBuiltImage(imageReference, extraRunArguments);
Expand All @@ -104,7 +104,7 @@ static String buildAndRunFromLocalBase(String target, String base)
"-Djib.allowInsecureRegistries=" + target.startsWith("localhost"),
"-b=" + "build-local-base.gradle");
assertBuildSuccess(buildResult, "jib", "Built and pushed image as ");
assertValidImageDigestAndIdOutputFiles(
assertThatExpectedImageDigestAndIdReturned(
SingleProjectIntegrationTest.simpleTestProject.getProjectRoot());
MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(target));
return pullAndRunBuiltImage(target);
Expand All @@ -123,7 +123,7 @@ static void buildAndRunAdditionalTag(
"-Djib.allowInsecureRegistries=" + imageReference.startsWith("localhost"),
"-D_ADDITIONAL_TAG=" + additionalTag);
assertBuildSuccess(buildResult, "jib", "Built and pushed image as ");
assertValidImageDigestAndIdOutputFiles(testProject.getProjectRoot());
assertThatExpectedImageDigestAndIdReturned(testProject.getProjectRoot());
MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(imageReference));

String additionalImageReference =
Expand All @@ -150,7 +150,7 @@ static BuildResult buildToDockerDaemon(
"-Djib.allowInsecureRegistries=" + imageReference.startsWith("localhost"),
"-b=" + gradleBuildFile);
assertBuildSuccess(buildResult, "jibDockerBuild", "Built image to Docker daemon as ");
assertValidImageDigestAndIdOutputFiles(testProject.getProjectRoot());
assertThatExpectedImageDigestAndIdReturned(testProject.getProjectRoot());
MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(imageReference));

String history = new Command("docker", "history", imageReference).run();
Expand Down Expand Up @@ -190,7 +190,7 @@ static Instant getCreationTime(String imageReference) throws IOException, Interr
return Instant.parse(inspect);
}

static void assertValidImageDigestAndIdOutputFiles(Path projectRoot)
static void assertThatExpectedImageDigestAndIdReturned(Path projectRoot)
throws IOException, DigestException {
Path digestPath = projectRoot.resolve("build/jib-image.digest");
Assert.assertTrue(Files.exists(digestPath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public void testBuild_dockerClient() throws IOException, InterruptedException, D
"--debug");
JibRunHelper.assertBuildSuccess(
buildResult, "jibDockerBuild", "Built image to Docker daemon as ");
JibRunHelper.assertValidImageDigestAndIdOutputFiles(simpleTestProject.getProjectRoot());
JibRunHelper.assertThatExpectedImageDigestAndIdReturned(simpleTestProject.getProjectRoot());
MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(targetImage));
MatcherAssert.assertThat(
buildResult.getOutput(), CoreMatchers.containsString("Docker load called. value1 value2"));
Expand Down

0 comments on commit ff8c5b2

Please sign in to comment.