-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
885c32d
commit 3128d29
Showing
3 changed files
with
45 additions
and
1 deletion.
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
38 changes: 38 additions & 0 deletions
38
src/test/java/com/github/jasper/kafka/KafkaInfluxDBMetricsReporterTest.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,38 @@ | ||
package com.github.jasper.kafka; | ||
|
||
import kafka.utils.VerifiableProperties; | ||
|
||
import java.util.Properties; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class KafkaInfluxDBMetricsReporterTest { | ||
|
||
@Test | ||
public void initWithoutPropertiesSet() { | ||
KafkaInfluxDBMetricsReporter reporter = new KafkaInfluxDBMetricsReporter(); | ||
reporter.init(new VerifiableProperties()); | ||
} | ||
|
||
@Test | ||
public void initStartStopWithPropertiesSet() { | ||
KafkaInfluxDBMetricsReporter reporter = new KafkaInfluxDBMetricsReporter(); | ||
Properties properties = new Properties(); | ||
properties.setProperty("kafka.graphite.metrics.reporter.enabled", "true"); | ||
|
||
reporter.init(new VerifiableProperties(properties)); | ||
|
||
reporter.startReporter(1L); | ||
reporter.stopReporter(); | ||
} | ||
|
||
|
||
@Test | ||
public void getMBeanName() { | ||
KafkaInfluxDBMetricsReporter reporter = new KafkaInfluxDBMetricsReporter(); | ||
assertEquals("kafka:type=com.github.jasper.kafka.KafkaInfluxDBMetricsReporter", reporter.getMBeanName()); | ||
|
||
} | ||
} |