ClassBasedTableTypeResolver implements TableTypeResolver { @Override public TableType resolve(final TableTypeReference reference) { final ClassBasedTableTypeReference<?> classBased = asClassBased(reference); return tableTypeFactory.create(classBased.getTable()); } ClassBasedTableTypeResolver(); @Override boolean canResolve(final TableTypeReference reference); @Override TableType resolve(final TableTypeReference reference);  }
@Test(expected = IllegalArgumentException.class) public void resolveANonClassBasedReference_should_throw() { resolver.resolve(anotherReference); }
@Test public void resolve_should_returnATable() { final TableType table = resolver.resolve(ClassBasedTableTypeReference.of(Table.class)); assertThat(table.getName(), is("MY_TABLE")); }