Skip to content

Commit

Permalink
Fix tests related to logger xml
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed Jan 5, 2022
1 parent f3625a9 commit 2e3f4f1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,21 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
List.of(
"<logger name=\"org.hibernate.validator\" level=\"WARN\"/>",
"<logger name=\"org.hibernate\" level=\"WARN\"/>",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\"/>"
"<logger name=\"org.hibernate.validator\" level=\"WARN\" />",
"<logger name=\"org.hibernate\" level=\"WARN\" />",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\" />"
)
);

assertFileContent(
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
"<logger name=\"org.hibernate.validator\" level=\"WARN\"/>",
"<logger name=\"org.hibernate\" level=\"WARN\"/>",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\"/>",
"<logger name=\"com.github.dockerjava\" level=\"WARN\"/>",
"<logger name=\"org.testcontainers\" level=\"WARN\"/>"
"<logger name=\"org.hibernate.validator\" level=\"WARN\" />",
"<logger name=\"org.hibernate\" level=\"WARN\" />",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\" />",
"<logger name=\"com.github.dockerjava\" level=\"WARN\" />",
"<logger name=\"org.testcontainers\" level=\"WARN\" />"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,23 @@ private void assertLoggerInConfig(Project project) {
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
List.of(
"<logger name=\"org.hibernate.validator\" level=\"WARN\"/>",
"<logger name=\"org.hibernate\" level=\"WARN\"/>",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\"/>",
"<logger name=\"org.postgresql\" level=\"WARN\"/>"
"<logger name=\"org.hibernate.validator\" level=\"WARN\" />",
"<logger name=\"org.hibernate\" level=\"WARN\" />",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\" />",
"<logger name=\"org.postgresql\" level=\"WARN\" />"
)
);

assertFileContent(
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
"<logger name=\"org.hibernate.validator\" level=\"WARN\"/>",
"<logger name=\"org.hibernate\" level=\"WARN\"/>",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\"/>",
"<logger name=\"org.postgresql\" level=\"WARN\"/>",
"<logger name=\"com.github.dockerjava\" level=\"WARN\"/>",
"<logger name=\"org.testcontainers\" level=\"WARN\"/>"
"<logger name=\"org.hibernate.validator\" level=\"WARN\" />",
"<logger name=\"org.hibernate\" level=\"WARN\" />",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\" />",
"<logger name=\"org.postgresql\" level=\"WARN\" />",
"<logger name=\"com.github.dockerjava\" level=\"WARN\" />",
"<logger name=\"org.testcontainers\" level=\"WARN\" />"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ private void assertLoggerInConfig(Project project) {
assertFileContent(
project,
getPath(MAIN_RESOURCES, LOGGING_CONFIGURATION),
List.of("<logger name=\"liquibase\" level=\"WARN\"/>", "<logger name=\"LiquibaseSchemaResolver\" level=\"INFO\"/>")
List.of("<logger name=\"liquibase\" level=\"WARN\" />", "<logger name=\"LiquibaseSchemaResolver\" level=\"INFO\" />")
);

assertFileContent(
project,
getPath(TEST_RESOURCES, LOGGING_TEST_CONFIGURATION),
List.of(
"<logger name=\"org.hibernate.validator\" level=\"WARN\"/>",
"<logger name=\"org.hibernate\" level=\"WARN\"/>",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\"/>"
"<logger name=\"org.hibernate.validator\" level=\"WARN\" />",
"<logger name=\"org.hibernate\" level=\"WARN\" />",
"<logger name=\"org.hibernate.ejb.HibernatePersistence\" level=\"OFF\" />"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void shouldAddLoggerWithLevel() {
service.addLogger(project, "tech.jhipster.web", Level.DEBUG);

String applicationProperties = getPath(MAIN_RESOURCES, "logback-spring.xml");
assertFileContent(project, applicationProperties, "<logger name=\"tech.jhipster.web\" level=\"DEBUG\"/>");
assertFileContent(project, applicationProperties, "<logger name=\"tech.jhipster.web\" level=\"DEBUG\" />");
assertFileContent(project, applicationProperties, "<!-- jhipster-needle-logback-add-log -->");
}
}
Expand All @@ -60,7 +60,7 @@ void shouldAddLoggerWithLevel() {
service.addLoggerTest(project, "tech.jhipster.web", Level.DEBUG);

String applicationProperties = getPath(TEST_RESOURCES, "logback.xml");
assertFileContent(project, applicationProperties, "<logger name=\"tech.jhipster.web\" level=\"DEBUG\"/>");
assertFileContent(project, applicationProperties, "<logger name=\"tech.jhipster.web\" level=\"DEBUG\" />");
assertFileContent(project, applicationProperties, "<!-- jhipster-needle-logback-add-log -->");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void shouldInit() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand All @@ -62,7 +62,7 @@ void shouldAddSpringBootMvc() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand All @@ -82,7 +82,7 @@ void shouldAddSpringBootMvcWithServerPort() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=7419");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand All @@ -102,7 +102,7 @@ void shouldAddSpringBootMvcWithInvalidServerPort() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"org.springframework.web\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand All @@ -121,7 +121,7 @@ void shouldAddSpringBootUndertow() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=8080");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"io.undertow\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"io.undertow\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand All @@ -141,7 +141,7 @@ void shouldAddSpringBootUndertowWithServerPort() {

assertFileContent(project, getPath(MAIN_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=1664");
assertFileContent(project, getPath(TEST_RESOURCES, "config", APPLICATION_PROPERTIES), "server.port=0");
assertLoggingConfiguration(project, "<logger name=\"io.undertow\" level=\"WARN\"/>");
assertLoggingConfiguration(project, "<logger name=\"io.undertow\" level=\"WARN\" />");

assertTestUtil(project);
assertExceptionHandler(project);
Expand Down

0 comments on commit 2e3f4f1

Please sign in to comment.