-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Refactor (YamlServletProfileInitializerTests)
- Should cleanup the Log Configuration [#162794188] https://www.pivotaltracker.com/story/show/162794188
- Loading branch information
1 parent
c369774
commit cf1ac78
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...rc/test/java/org/cloudfoundry/identity/uaa/impl/config/LoggerContextCleanupExtension.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,27 @@ | ||
package org.cloudfoundry.identity.uaa.impl.config; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.core.LoggerContext; | ||
import org.junit.jupiter.api.extension.AfterAllCallback; | ||
import org.junit.jupiter.api.extension.BeforeAllCallback; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
||
import java.net.URI; | ||
|
||
public class LoggerContextCleanupExtension implements BeforeAllCallback, AfterAllCallback { | ||
|
||
private URI configLocation = null; | ||
|
||
@Override | ||
public void beforeAll(ExtensionContext context) { | ||
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false); | ||
configLocation = loggerContext.getConfigLocation(); | ||
} | ||
|
||
@Override | ||
public void afterAll(ExtensionContext context) { | ||
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false); | ||
loggerContext.setConfigLocation(configLocation); | ||
} | ||
|
||
} |
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