Search in sources :

Example 81 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testAnnotatedSetterNullDeserialization.

@Test
public void testAnnotatedSetterNullDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("annotatedSetter", NullNode.getInstance());
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getAnnotatedSetter()).isNull();
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 82 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testJsonNodeNullDeserialization.

@Test
public void testJsonNodeNullDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("jsonNodeField", NullNode.getInstance());
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getJsonNodeField()).isEqualTo(NullNode.getInstance());
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 83 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testBinaryFieldWithDefaultNullDeserialization.

@Test
public void testBinaryFieldWithDefaultNullDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("binaryFieldWithDefault", NullNode.getInstance());
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getBinaryFieldWithDefault().getStringProperty()).isEqualTo("value");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 84 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testAnnotatedFieldDeserialization.

@Test
public void testAnnotatedFieldDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("annotatedField", expected);
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getAnnotatedField().getStringProperty()).isEqualTo("value");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Example 85 with ObjectNode

use of com.fasterxml.jackson.databind.node.ObjectNode in project Rosetta by HubSpot.

the class StoredAsJsonTest method testAnnotatedGetterWithDefaultDeserialization.

@Test
public void testAnnotatedGetterWithDefaultDeserialization() throws JsonProcessingException {
    ObjectNode node = Rosetta.getMapper().createObjectNode();
    node.put("annotatedGetterWithDefault", expected);
    StoredAsJsonBean bean = Rosetta.getMapper().treeToValue(node, StoredAsJsonBean.class);
    assertThat(bean.getAnnotatedGetterWithDefault().getStringProperty()).isEqualTo("value");
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) StoredAsJsonBean(com.hubspot.rosetta.beans.StoredAsJsonBean) Test(org.junit.Test)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)769 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)185 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)167 JsonNode (com.fasterxml.jackson.databind.JsonNode)165 Test (org.junit.Test)112 StringEntity (org.apache.http.entity.StringEntity)88 Deployment (org.activiti.engine.test.Deployment)84 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)67 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)64 Task (org.activiti.engine.task.Task)49 HttpPost (org.apache.http.client.methods.HttpPost)49 JCodeModel (com.sun.codemodel.JCodeModel)45 JPackage (com.sun.codemodel.JPackage)44 IOException (java.io.IOException)44 HttpPut (org.apache.http.client.methods.HttpPut)40 JType (com.sun.codemodel.JType)39 HashMap (java.util.HashMap)39 Cluster (org.apache.geode.tools.pulse.internal.data.Cluster)39 Map (java.util.Map)33 ArrayList (java.util.ArrayList)32