예제 #1
0
  @Test
  public void getConvertibleTypes() {
    final Set<ConvertiblePair> convertibleTypes = converter.getConvertibleTypes();
    Assert.assertEquals(1, convertibleTypes.size());

    final ConvertiblePair convertiblePair = convertibleTypes.iterator().next();
    Assert.assertSame(Object.class, convertiblePair.getSourceType());
    Assert.assertSame(Object.class, convertiblePair.getTargetType());
  }
예제 #2
0
  @Test
  public void convert() {
    beanMapper.map("METHOD", ElementType.class);
    EasyMock.expectLastCall().andReturn(ElementType.METHOD);
    EasyMock.replay(beanMapper);

    Assert.assertEquals(
        ElementType.METHOD,
        converter.convert("METHOD", null, TypeDescriptor.valueOf(ElementType.class)));
    EasyMock.verify(beanMapper);
  }
예제 #3
0
 @Test
 public void convertNull() {
   Assert.assertNull(converter.convert(null, null, null));
 }