Skip to content

Commit

Permalink
[test] fix refactored functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk committed Jun 13, 2017
1 parent f8bd2e9 commit e8c62fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/org/datadog/jmxfetch/TestCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ protected void initApplication(String yamlFileName, String serviceDiscoveryPipeF
if (sdEnabled) {
String SDPipe = Thread.currentThread().getContextClassLoader().getResource(
serviceDiscoveryPipeFile).getPath();
when(appConfig.getServiceDiscoveryPipe()).thenReturn(SDPipe); //mocking with fixture file.
when(appConfig.getAutoDiscoveryPipe()).thenReturn(SDPipe); //mocking with fixture file.
}

app = new App(appConfig);
if (sdEnabled) {
FileInputStream sdPipe = new FileInputStream(appConfig.getServiceDiscoveryPipe());
FileInputStream sdPipe = new FileInputStream(appConfig.getAutoDiscoveryPipe());
int len = sdPipe.available();
byte[] buffer = new byte[len];
sdPipe.read(buffer);
app.setReinit(app.processServiceDiscovery(buffer));
app.setReinit(app.processAutoDiscovery(buffer));
}

app.init(false);
Expand Down

0 comments on commit e8c62fb

Please sign in to comment.