### Question:
ObjectNodeCoercing extends BaseCoercing { @Override public Object parseLiteral(Object input, Map<String, Object> variables) throws CoercingParseLiteralException { if (!(input instanceof ObjectValue)) { log.error("Expected 'ObjectValue', got: {}", input); throw new CoercingParseLiteralException("Expected 'ObjectValue', got: " + input); } return JsonCoercingUtil.parseLiteral(input, variables); }  @Override Object parseValue(Object input); @Override Object parseLiteral(Object input, Map<String, Object> variables);  }### Answer:
@Test public void parseLiteral() { Value input = ObjectValue.newObjectValue() .objectField(ObjectField.newObjectField() .name("a") .value(StringValue.newStringValue("b").build()) .build()) .build(); ObjectNodeCoercing spy = Mockito.spy(underTest); Object parsed = new Object(); when(spy.parseLiteral(input, emptyMap())).thenReturn(parsed); Object result = spy.parseLiteral(input); assertThat(result, is(sameInstance(parsed))); }
@Test(expected = CoercingParseLiteralException.class) public void parseLiteralNotAnObjectNode() { underTest.parseLiteral(ArrayValue.newArrayValue().build(), emptyMap()); }