Skip to content

Commit

Permalink
[7.16] Tolerate benign log4j status messages in tests (elastic#81851) (
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty authored and pgomulka committed Dec 20, 2021
1 parent 93059b7 commit e8db0f2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public void log(StatusData data) {

// Tolerate the absence or otherwise denial of these specific lookup classes.
// At some future time, we should require the JDNI warning.
private static final List<String> LOG_4J_MSG_PREFIXES = List.of(
private static final List<String> LOG_4J_MSG_PREFIXES = org.elasticsearch.core.List.of(
"JNDI lookup class is not available because this JRE does not support JNDI. "
+ "JNDI string lookups will not be available, continuing configuration.",
"JMX runtime input lookup class is not available because this JRE does not support JMX. "
Expand All @@ -659,7 +659,8 @@ protected static void checkStaticState() throws Exception {
statusData.stream().map(status -> status.getMessage().getFormattedMessage()).collect(Collectors.toList()),
anyOf(
emptyCollectionOf(String.class),
contains(startsWith(LOG_4J_MSG_PREFIXES.get(0)), startsWith(LOG_4J_MSG_PREFIXES.get(1)))
contains(startsWith(LOG_4J_MSG_PREFIXES.get(0)), startsWith(LOG_4J_MSG_PREFIXES.get(1))),
contains(startsWith(LOG_4J_MSG_PREFIXES.get(1)))
)
);
} finally {
Expand Down

0 comments on commit e8db0f2

Please sign in to comment.