@Test public void testUnannotatedObject() throws Exception { Method getter = UnannotatedSubClass.class.getMethod("getChild"); Method setter = UnannotatedSubClass.class.getMethod("setChild", UnannotatedSubClass.class); try { CONVERTER.unconvert(getter, setter, new AttributeValue().withS("")); Assert.fail("Expected DynamoDBMappingException"); } catch (DynamoDBMappingException e) { } }
public Object unconvert(String getter, String setter, AttributeValue value) { try { Method gm = TestClass.class.getMethod(getter); Method sm = TestClass.class.getMethod(setter, gm.getReturnType()); return CONVERTER.unconvert(gm, sm, value); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException("BOOM", e); } }