use of com.hubspot.rosetta.beans.OptionalStoredAsJsonBeanIF.OptionalStoredAsJsonBean in project Rosetta by HubSpot.
the class StoredAsJsonTest method testSerializingOptionalStoredAsJsonBean.
@Test
public void testSerializingOptionalStoredAsJsonBean() {
OptionalStoredAsJsonBean bean = new OptionalStoredAsJsonBean(java.util.Optional.of(new PolymorphicBeanA()));
JsonNode node = Rosetta.getMapper().valueToTree(bean);
assertThat(node.get("bean")).isNotNull();
assertThat(node.get("bean").textValue()).contains("beanType");
}
use of com.hubspot.rosetta.beans.OptionalStoredAsJsonBeanIF.OptionalStoredAsJsonBean in project Rosetta by HubSpot.
the class StoredAsJsonTest method testSerializingOptionalStoredAsJsonSubtypeBean.
@Test
public void testSerializingOptionalStoredAsJsonSubtypeBean() {
OptionalStoredAsJsonBean bean = new OptionalStoredAsJsonBean(java.util.Optional.of(new PolymorphicBeanASubTypeA()));
JsonNode node = Rosetta.getMapper().valueToTree(bean);
assertThat(node.get("bean")).isNotNull();
assertThat(node.get("bean").textValue()).contains("beanType");
}
Aggregations