Пример #1
0
  @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) {
    }
  }
Пример #2
0
  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);
    }
  }