Search in sources :

Example 1 with MapStoredAsJsonBean

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

the class StoredAsJsonTest method testSerializingMapStoredAsJsonBean.

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

Aggregations

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