-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(log4j): add missing Log4j Core plugin descriptor (5848)
Fix #5847: missing Log4j Core plugin descriptor Due to a misconfiguration of the Maven Bundle Plugin, the Log4j Core plugin descriptor: ``` META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat ``` file is missing in the generated JAR. This PR fixes the Maven configuration and adds a simple integration test to prevent ensure that `PluginManager` is able to detect the Kubernetes Lookup. --- Add changelog for #5848 --- Remove `public` modifier from JUnit 5 test
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
log4j/src/test/java/io/fabric8/kubernetes/log4j/lookup/it/KubernetesLookupIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.kubernetes.log4j.lookup.it; | ||
|
||
import io.fabric8.kubernetes.log4j.lookup.KubernetesLookup; | ||
import org.apache.logging.log4j.core.config.plugins.util.PluginManager; | ||
import org.apache.logging.log4j.core.config.plugins.util.PluginType; | ||
import org.apache.logging.log4j.core.lookup.StrLookup; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class KubernetesLookupIT { | ||
|
||
@Test | ||
void should_find_lookup() { | ||
PluginManager manager = new PluginManager(StrLookup.CATEGORY); | ||
manager.collectPlugins(); | ||
PluginType<?> pluginType = manager.getPluginType("k8s"); | ||
assertThat(pluginType) | ||
.as("check 'k8s' lookup") | ||
.isNotNull() | ||
.extracting(PluginType::getPluginClass) | ||
.isEqualTo(KubernetesLookup.class); | ||
} | ||
} |