Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d34f43c

Browse files
committedJan 31, 2025·
Update tests
1 parent 824955c commit d34f43c

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed
 

‎buildpacks/maven/tests/integration/customization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use libcnb_test::{assert_contains, TestRunner};
77
fn maven_custom_goals() {
88
TestRunner::default().build(default_build_config("test-apps/simple-http-service").env("MAVEN_CUSTOM_GOALS", "site"), |context| {
99
// Assert only the goals in MAVEN_CUSTOM_GOALS are executed
10-
assert_contains!(context.pack_stdout, "./mvnw -DskipTests site");
10+
assert_contains!(context.pack_stdout, "Running `./mvnw -DskipTests -B site`");
1111
assert_contains!(context.pack_stdout,"[INFO] --- maven-site-plugin:3.7.1:site (default-site) @ simple-http-service ---");
1212

1313
// The dependency list is implemented by using the dependency:list goal. We need to

‎buildpacks/maven/tests/integration/misc.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,18 @@ fn no_internal_maven_options_logging() {
117117
#[test]
118118
#[ignore = "integration test"]
119119
fn descriptive_error_message_on_failed_build() {
120-
TestRunner::default().build(default_build_config("test-apps/app-with-compile-error").expected_pack_result(PackResult::Failure), |context| {
120+
TestRunner::default().build(
121+
default_build_config("test-apps/app-with-compile-error")
122+
.expected_pack_result(PackResult::Failure),
123+
|context| {
121124
assert_contains!(context.pack_stdout, "[INFO] BUILD FAILURE");
122125

123-
assert_contains!(
124-
context.pack_stderr,
125-
"! ERROR: Unexpected Maven exit code"
126-
);
126+
assert_contains!(context.pack_stderr, "! ERROR: Unexpected Maven exit code");
127127

128128
assert_contains!(
129129
context.pack_stderr,
130-
"Maven unexpectedly exited with code '1'. The most common reason for this are\nproblems with your application code and/or build configuration."
130+
"Maven unexpectedly exited with code '1'."
131131
);
132-
});
132+
},
133+
);
133134
}

‎buildpacks/maven/tests/integration/settings_xml.rs

+17-12
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@ fn maven_settings_url_success() {
2626
fn maven_settings_url_failure() {
2727
TestRunner::default().build(
2828
default_build_config("test-apps/simple-http-service")
29-
.env("MAVEN_SETTINGS_URL", SETTINGS_XML_URL_404)
30-
.expected_pack_result(PackResult::Failure),
31-
|context| {
32-
assert_contains!(
33-
context.pack_stderr,
34-
&format!("You have set MAVEN_SETTINGS_URL to \"{SETTINGS_XML_URL_404}\". We tried to download the file at this\nURL, but the download failed. Please verify that the given URL is correct and try again.")
35-
);
36-
37-
// This error message comes from Maven itself. We don't expect Maven to to be executed at all.
38-
assert_not_contains!(context.pack_stdout, "[INFO] BUILD FAILURE");
39-
},
40-
);
29+
.env("MAVEN_SETTINGS_URL", SETTINGS_XML_URL_404)
30+
.expected_pack_result(PackResult::Failure),
31+
|context| {
32+
assert_contains!(
33+
context.pack_stderr,
34+
&format!("You have set MAVEN_SETTINGS_URL to \"{SETTINGS_XML_URL_404}\".")
35+
);
36+
37+
assert_contains!(
38+
context.pack_stderr,
39+
"Please verify that the given URL is correct and try again."
40+
);
41+
42+
// This error message comes from Maven itself. We don't expect Maven to to be executed at all.
43+
assert_not_contains!(context.pack_stdout, "[INFO] BUILD FAILURE");
44+
},
45+
);
4146
}
4247

4348
#[test]

0 commit comments

Comments
 (0)
Please sign in to comment.