-
Notifications
You must be signed in to change notification settings - Fork 11
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
51f8440
commit 30056a4
Showing
4 changed files
with
72 additions
and
8 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
29 changes: 29 additions & 0 deletions
29
server/src/test/java/io/littlehorse/common/model/getable/objectId/MetricIdTest.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,29 @@ | ||
package io.littlehorse.common.model.getable.objectId; | ||
|
||
|
||
import io.littlehorse.sdk.common.proto.MetricType; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class MetricIdTest { | ||
|
||
@Test | ||
public void shouldSerializeToStringForWfSpecMetrics() { | ||
WfSpecIdModel wfSpecId = new WfSpecIdModel("test-wf", 0, 1); | ||
MetricIdModel expected = new MetricIdModel(wfSpecId, MetricType.AVG); | ||
MetricIdModel deserialized = new MetricIdModel(); | ||
deserialized.initFromString(expected.toString()); | ||
Assertions.assertEquals(expected, deserialized); | ||
} | ||
|
||
@Test | ||
public void shouldSerializeToStringForMeasurableObject() { | ||
WfSpecIdModel wfSpecId = new WfSpecIdModel("test-wf", 0, 1); | ||
MetricIdModel expected = new MetricIdModel(wfSpecId, MetricType.AVG); | ||
MetricIdModel deserialized = new MetricIdModel(); | ||
deserialized.initFromString(expected.toString()); | ||
Assertions.assertEquals(expected, deserialized); | ||
} | ||
|
||
|
||
} |