PagedSearchConverter extends AbstractConverter<PagedResult<?>, PagedResultResource<? extends ApiResource>> { @Override public PagedResultResource<? extends ApiResource> convert(final PagedResult<?> source) { throw new UnsupportedOperationException(); }  @Override PagedResultResource<? extends ApiResource> convert(final PagedResult<?> source); @Override PagedResultResource<? extends ApiResource> convert(final PagedResult<?> source, final PagedResultResource<? extends ApiResource> target);  }
@Test public void testConvert() throws Exception { Integer offset = 100; Integer limit = 0; long count = 150; List<Department> entities = Collections.emptyList(); PagedResult<Department> source = new PagedResult<Department>(offset, limit, count, entities); PagedResultResource<? extends ApiResource> expected = new PagedResultResource<ApiResource>(); expected.setOffset(offset); expected.setLimit(limit); expected.setCount(count); PagedResultResource<? extends ApiResource> actual = new PagedResultResource<ApiResource>(); unit.convert(source, actual); assertEquals(expected, actual); }
@Test(expected = UnsupportedOperationException.class) public void testConvertWithOneArgument() throws Exception { unit.convert(null); }