Search in sources :

Example 1 with UniqueEntriesHighlighter

use of com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter in project beakerx by twosigma.

the class UniqueEntriesHighlighterSerializerTest method serializeColumnName_resultJsonHasColumnName.

@Test
public void serializeColumnName_resultJsonHasColumnName() throws IOException {
    // given
    UniqueEntriesHighlighter highlighter = (UniqueEntriesHighlighter) TableDisplayCellHighlighter.getUniqueEntriesHighlighter("a");
    // when
    JsonNode actualObj = serializeHighliter(highlighter);
    // then
    Assertions.assertThat(actualObj.has("colName")).isTrue();
    Assertions.assertThat(actualObj.get("colName").asText()).isEqualTo("a");
}
Also used : UniqueEntriesHighlighter(com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 2 with UniqueEntriesHighlighter

use of com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter in project beakerx by twosigma.

the class UniqueEntriesHighlighterSerializerTest method serializeUniqueEntriesHighlighter_resultJsonHasType.

@Test
public void serializeUniqueEntriesHighlighter_resultJsonHasType() throws IOException {
    // given
    UniqueEntriesHighlighter highlighter = (UniqueEntriesHighlighter) TableDisplayCellHighlighter.getUniqueEntriesHighlighter("a");
    // when
    JsonNode actualObj = serializeHighliter(highlighter);
    // then
    Assertions.assertThat(actualObj.has("type")).isTrue();
    Assertions.assertThat(actualObj.get("type").asText()).isEqualTo("UniqueEntriesHighlighter");
}
Also used : UniqueEntriesHighlighter(com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 3 with UniqueEntriesHighlighter

use of com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter in project beakerx by twosigma.

the class UniqueEntriesHighlighterSerializerTest method serializeStyle_resultJsonHasStyle.

@Test
public void serializeStyle_resultJsonHasStyle() throws IOException {
    // given
    UniqueEntriesHighlighter highlighter = (UniqueEntriesHighlighter) TableDisplayCellHighlighter.getUniqueEntriesHighlighter("a", HighlightStyle.SINGLE_COLUMN);
    // when
    JsonNode actualObj = serializeHighliter(highlighter);
    // then
    Assertions.assertThat(actualObj.has("style")).isTrue();
    Assertions.assertThat(actualObj.get("style").asText()).isEqualTo("SINGLE_COLUMN");
}
Also used : UniqueEntriesHighlighter(com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)3 KernelTest (com.twosigma.beakerx.KernelTest)3 UniqueEntriesHighlighter (com.twosigma.beakerx.table.highlight.UniqueEntriesHighlighter)3 Test (org.junit.Test)3