コード例 #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));
 }