-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FFM-4023] - JavaSDK local connector doesn't create metrics folder (#162
) What Fixes exception reported by LocalConnector when sub-folders are missing. Why LocalConnector needs flags, segments, metrics and a domain folder to exist before writing to them. Testing New unit test
- Loading branch information
1 parent
16e6b41
commit 614faef
Showing
2 changed files
with
31 additions
and
0 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
28 changes: 28 additions & 0 deletions
28
src/test/java/io/harness/cf/client/connector/LocalConnectorTest.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,28 @@ | ||
package io.harness.cf.client.connector; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import io.harness.cf.model.Metrics; | ||
import java.util.ArrayList; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class LocalConnectorTest { | ||
|
||
@Test | ||
void shouldNotThrowExceptionsIfFoldersDontExist() { | ||
String source = "LocalConnectorTestSource"; | ||
|
||
Metrics metrics = new Metrics(); | ||
metrics.metricsData(new ArrayList<>()); | ||
metrics.targetData(new ArrayList<>()); | ||
|
||
assertDoesNotThrow( | ||
() -> { | ||
LocalConnector connector = new LocalConnector(source); | ||
connector.listFiles(source, "domain"); | ||
connector.getFlags(); | ||
connector.getSegments(); | ||
connector.postMetrics(metrics); | ||
}); | ||
} | ||
} |