use of io.mantisrx.common.Label in project mantis by Netflix.
the class LabelUtilsTest method testSomePairsPresent3.
@Test
public void testSomePairsPresent3() {
String tagQuery = "";
List<Label> expectedPairs = LabelUtils.generatePairs(tagQuery);
List<Label> actualPairs = new ArrayList<>();
actualPairs.add(new Label("k4", "v1"));
actualPairs.add(new Label("k5", "v2"));
assertFalse(LabelUtils.somePairsPresent(expectedPairs, actualPairs));
}
use of io.mantisrx.common.Label in project mantis by Netflix.
the class LabelUtilsTest method testSerDe.
@Test
public void testSerDe() {
Label l = new Label("k1", "v1");
ObjectMapper mapper = new ObjectMapper();
try {
System.out.println(mapper.writeValueAsString(l));
} catch (JsonProcessingException e) {
fail();
}
}
use of io.mantisrx.common.Label in project mantis by Netflix.
the class LabelUtilsTest method testAllPairsPresent.
@Test
public void testAllPairsPresent() {
String tagQuery = "k1=v1,k2=v2,k3=v3";
List<Label> expectedPairs = LabelUtils.generatePairs(tagQuery);
List<Label> actualPairs = new ArrayList<>();
actualPairs.add(new Label("k1", "v1"));
actualPairs.add(new Label("k2", "v2"));
actualPairs.add(new Label("k3", "v3"));
assertTrue(LabelUtils.allPairsPresent(expectedPairs, actualPairs));
}
use of io.mantisrx.common.Label in project mantis by Netflix.
the class LabelUtilsTest method testGeneratePairPartialMalformed.
@Test
public void testGeneratePairPartialMalformed() {
String tagQuery = "k1=,k2=v2";
List<Label> pairs = LabelUtils.generatePairs(tagQuery);
assertEquals(1, pairs.size());
assertEquals(new Label("k2", "v2"), pairs.get(0));
}
use of io.mantisrx.common.Label in project mantis by Netflix.
the class LabelUtilsTest method testSomePairsPresent2.
@Test
public void testSomePairsPresent2() {
String tagQuery = "k1=v1,k2=v2,k3=v3";
List<Label> expectedPairs = LabelUtils.generatePairs(tagQuery);
List<Label> actualPairs = new ArrayList<>();
actualPairs.add(new Label("k4", "v1"));
actualPairs.add(new Label("k5", "v2"));
assertFalse(LabelUtils.somePairsPresent(expectedPairs, actualPairs));
}
Aggregations