Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
xyuanlu committed Dec 7, 2024
1 parent 162dc29 commit 1bf8068
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -90,6 +91,16 @@ public void testEnabledInstanceBackwardCompatibility() {
Assert.assertFalse(instanceConfig.getInstanceEnabled());
}

@Test
public void testInstanceOperationDeserialize() {
ZNRecord znRecord = new ZNRecord("id");
znRecord.setListField("HELIX_INSTANCE_OPERATIONS",
List.of("{\"OPERATION\":\"EVACUATE\",\"TIMESTAMP\":\"1733518029415\",\"SOURCE\":\"USER\",\"REASON\":\"\"}"));
InstanceConfig instanceConfig = new InstanceConfig(znRecord);
Assert.assertEquals(instanceConfig.getInstanceOperation().getOperation(),
InstanceConstants.InstanceOperation.EVACUATE);
}

@Test
public void testGetParsedDomainEmptyDomain() {
InstanceConfig instanceConfig = new InstanceConfig(new ZNRecord("id"));
Expand Down

0 comments on commit 1bf8068

Please sign in to comment.