Skip to content

Commit 0045bca

Browse files
committed
chore: remove sonar issues
1 parent cdf14a5 commit 0045bca

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Turbo Unit shows a range of complex use case on unit testing (based on Junit 5)
66
[![license](https://img.shields.io/badge/License-Apache%20License%202.0-teal.svg)](https://opensource.org/licenses/Apache-2.0)
77
[![code of conduct](https://img.shields.io/badge/conduct-Contributor%20Covenant-purple.svg)](https://github.com/fugerit-org/fj-universe/blob/main/CODE_OF_CONDUCT.md)
88
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_turbo-unit&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fugerit-org_turbo-unit)
9+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_turbo-unit&metric=coverage)](https://sonarcloud.io/summary/new_code?id=fugerit-org_turbo-unit)
910

1011
[![Java runtime version](https://img.shields.io/badge/run%20on-java%208+-%23113366.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)
1112
[![Java build version](https://img.shields.io/badge/build%20on-java%2011+-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)

turbo-unit-core/src/test/java/org/fugerit/java/turbo/unit/core/jul/TestExampleJavaUtilLogging.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void testLogHello() {
3030
/*
3131
* Store the log level to restore at the end
3232
*/
33-
private static Level PREVIOUS_LEVEL;
33+
private static Level previousLevel;
3434

3535
/*
3636
* The logger to configure in order to intercept the log message
@@ -45,24 +45,24 @@ public static class LogMessageInterceptorHandler extends Handler {
4545
private Set<String> messages = new HashSet<>();
4646

4747
@Override
48-
public void publish(LogRecord record) {
48+
public void publish(LogRecord lr) {
4949
// add log messages to a set
50-
this.messages.add(record.getMessage());
50+
this.messages.add(lr.getMessage());
5151
}
5252

5353
@Override
5454
public void flush() {
55-
55+
// no need to customize this method
5656
}
5757

5858
@Override
5959
public void close() throws SecurityException {
60-
60+
// no need to customize this method
6161
}
6262

6363
@Override
64-
public boolean isLoggable(LogRecord record) {
65-
return super.isLoggable(record);
64+
public boolean isLoggable(LogRecord lr) {
65+
return super.isLoggable(lr);
6666
}
6767

6868
public boolean containsLogMessage(String message) {
@@ -73,18 +73,18 @@ public boolean containsLogMessage(String message) {
7373
}
7474

7575
@BeforeAll
76-
public static void start() {
76+
static void start() {
7777
// add log message intercepting handler
7878
logger.addHandler(LOG_MESSAGE_INTERCEPTOR_HANDLER);
79-
PREVIOUS_LEVEL = logger.getLevel();
79+
previousLevel = logger.getLevel();
8080
logger.setLevel(Level.FINEST);
8181
}
8282

8383
@AfterAll
84-
public static void end() {
84+
static void end() {
8585
// restore the logger status
8686
logger.removeHandler(LOG_MESSAGE_INTERCEPTOR_HANDLER);
87-
logger.setLevel(PREVIOUS_LEVEL);
87+
logger.setLevel(previousLevel);
8888
}
8989

9090
}

0 commit comments

Comments
 (0)