Search in sources :

Example 1 with SetStoredAsJsonBean

use of com.hubspot.rosetta.beans.SetStoredAsJsonBean in project Rosetta by HubSpot.

the class StoredAsJsonTest method testSerializingSetStoredAsJsonBean.

@Test
public void testSerializingSetStoredAsJsonBean() {
    SetStoredAsJsonBean bean = new SetStoredAsJsonBean(ImmutableSet.of(new PolymorphicBeanA()));
    JsonNode node = Rosetta.getMapper().valueToTree(bean);
    assertThat(node.get("beans")).isNotNull();
    assertThat(node.get("beans").textValue()).contains("beanType");
}
Also used : SetStoredAsJsonBean(com.hubspot.rosetta.beans.SetStoredAsJsonBean) PolymorphicBeanA(com.hubspot.rosetta.beans.PolymorphicBeanA) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 PolymorphicBeanA (com.hubspot.rosetta.beans.PolymorphicBeanA)1 SetStoredAsJsonBean (com.hubspot.rosetta.beans.SetStoredAsJsonBean)1 Test (org.junit.Test)1