DATACMNS-1289 - Polishing.

Original pull request: #280.
This commit is contained in:
Oliver Gierke
2018-04-06 15:14:49 +02:00
parent 532af1a6b9
commit 500a1c627d
2 changed files with 7 additions and 1 deletions

View File

@@ -161,6 +161,12 @@ public interface RepositoryFragment<T> {
private final Optional<Class<T>> interfaceClass;
private final T implementation;
/**
* Creates a new {@link ImplementedRepositoryFragment} for the given interface class and implementation.
*
* @param interfaceClass must not be {@literal null}.
* @param implementation must not be {@literal null}.
*/
public ImplementedRepositoryFragment(Optional<Class<T>> interfaceClass, T implementation) {
Assert.notNull(interfaceClass, "Interface class must not be null!");

View File

@@ -26,8 +26,8 @@ import org.junit.Test;
*/
public class RepositoryFragmentUnitTests {
@SuppressWarnings("unchecked")
@Test // DATACMNS-1289
@SuppressWarnings("unchecked")
public void fragmentCreationFromUnrelatedTypesShouldFail() {
assertThatThrownBy(() -> RepositoryFragment.implemented((Class) CustomFragment.class, new UnrelatedImpl()))