Search in sources :

Example 1 with ListStoredAsJsonBean

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

the class StoredAsJsonTest method testSerializingListStoredAsJsonBean.

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

Aggregations

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