-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from bonitoo-io/influxdb-java-issue-413
issues #413 : Debug mode which allows HTTP requests being sent to the…
- Loading branch information
Showing
4 changed files
with
73 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.influxdb; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.influxdb.InfluxDB.LogLevel; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.platform.runner.JUnitPlatform; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Test the InfluxDBimpl log level setting from system property. | ||
* | ||
* @author hoan.le [at] bonitoo.io | ||
* | ||
*/ | ||
@RunWith(JUnitPlatform.class) | ||
public class LogLevelTest { | ||
@Test | ||
public void testParseLogLevel() { | ||
Map<String, LogLevel> logLevelMap = new HashMap<>(); | ||
logLevelMap.put(null, LogLevel.NONE); | ||
logLevelMap.put("NONE", LogLevel.NONE); | ||
logLevelMap.put("BASIC", LogLevel.BASIC); | ||
logLevelMap.put("HEADERS", LogLevel.HEADERS); | ||
logLevelMap.put("FULL", LogLevel.FULL); | ||
logLevelMap.put("abc", LogLevel.NONE); | ||
logLevelMap.forEach((value, logLevel) -> { | ||
Assertions.assertEquals(LogLevel.parseLogLevel(value), logLevel); | ||
}); | ||
} | ||
} |