@Test(expected = SdkClientException.class) public void invalidJsonNode_ThrowsException() throws IOException { JsonNode mock = Mockito.mock(JsonNode.class); Mockito.doThrow(new JsonMappingException("BOOM")) .when(mock).serialize(any(JsonGenerator.class), any(SerializerProvider.class)); jsonToString(mock); }
public static String jsonToString(JsonNode node) { try { return node == null ? null : MAPPER.writeValueAsString(node); } catch (JsonProcessingException e) { throw new SdkClientException("Could not serialize JSON", e); } }
JacksonUtils { public static String jsonToString(JsonNode node) { try { return node == null ? null : MAPPER.writeValueAsString(node); } catch (JsonProcessingException e) { throw new SdkClientException("Could not serialize JSON", e); } } }
JacksonUtils { public static String jsonToString(JsonNode node) { try { return node == null ? null : MAPPER.writeValueAsString(node); } catch (JsonProcessingException e) { throw new SdkClientException("Could not serialize JSON", e); } } private  JacksonUtils(); }
JacksonUtils { public static String jsonToString(JsonNode node) { try { return node == null ? null : MAPPER.writeValueAsString(node); } catch (JsonProcessingException e) { throw new SdkClientException("Could not serialize JSON", e); } } private  JacksonUtils(); static String jsonToString(JsonNode node); static JsonNode stringToJsonNode(String paramName, String val); static JsonNode objectToJsonNode(Object val); }
JacksonUtils { public static String jsonToString(JsonNode node) { try { return node == null ? null : MAPPER.writeValueAsString(node); } catch (JsonProcessingException e) { throw new SdkClientException("Could not serialize JSON", e); } } private  JacksonUtils(); static String jsonToString(JsonNode node); static JsonNode stringToJsonNode(String paramName, String val); static JsonNode objectToJsonNode(Object val);  }