Search in sources :

Example 1 with NestedStoredAsJsonBean

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

the class StoredAsJsonTest method testNestedStoredAsJsonBeans.

@Test
@Ignore
public void testNestedStoredAsJsonBeans() throws JsonProcessingException {
    InnerBean innerBean = new InnerBean();
    innerBean.setStringProperty("value");
    StoredAsJsonBean storedAsJsonBean = new StoredAsJsonBean();
    storedAsJsonBean.setAnnotatedField(innerBean);
    NestedStoredAsJsonBean top = new NestedStoredAsJsonBean();
    top.setAnnotatedField(storedAsJsonBean);
    JsonNode node = Rosetta.getMapper().valueToTree(top);
    assertThat(Rosetta.getMapper().treeToValue(node, NestedStoredAsJsonBean.class)).isEqualTo(top);
}
Also used : InnerBean(com.hubspot.rosetta.beans.InnerBean) SetStoredAsJsonBean(com.hubspot.rosetta.beans.SetStoredAsJsonBean) OptionalStoredAsJsonBean(com.hubspot.rosetta.beans.OptionalStoredAsJsonBeanIF.OptionalStoredAsJsonBean) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) MapStoredAsJsonBean(com.hubspot.rosetta.beans.MapStoredAsJsonBean) NestedStoredAsJsonBean(com.hubspot.rosetta.beans.NestedStoredAsJsonBean) ListStoredAsJsonBean(com.hubspot.rosetta.beans.ListStoredAsJsonBeanIF.ListStoredAsJsonBean) PolymorphicStoredAsJsonBean(com.hubspot.rosetta.beans.PolymorphicStoredAsJsonBean) NestedStoredAsJsonBean(com.hubspot.rosetta.beans.NestedStoredAsJsonBean) JsonNode(com.fasterxml.jackson.databind.JsonNode) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 InnerBean (com.hubspot.rosetta.beans.InnerBean)1 ListStoredAsJsonBean (com.hubspot.rosetta.beans.ListStoredAsJsonBeanIF.ListStoredAsJsonBean)1 MapStoredAsJsonBean (com.hubspot.rosetta.beans.MapStoredAsJsonBean)1 NestedStoredAsJsonBean (com.hubspot.rosetta.beans.NestedStoredAsJsonBean)1 OptionalStoredAsJsonBean (com.hubspot.rosetta.beans.OptionalStoredAsJsonBeanIF.OptionalStoredAsJsonBean)1 PolymorphicStoredAsJsonBean (com.hubspot.rosetta.beans.PolymorphicStoredAsJsonBean)1 SetStoredAsJsonBean (com.hubspot.rosetta.beans.SetStoredAsJsonBean)1 StoredAsJsonBean (com.hubspot.rosetta.beans.StoredAsJsonBean)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1