DATAJPA-1250 - Polishing.
New tests with AssertJ. Formatting for one assertion per line.
This commit is contained in:
@@ -34,7 +34,10 @@ public class InspectionClassLoaderUnitTests {
|
||||
Class<?> isolated = classLoader.loadClass("org.hsqldb.Database");
|
||||
Class<?> included = getClass().getClassLoader().loadClass("org.hsqldb.Database");
|
||||
|
||||
assertThat(isolated.getClassLoader()).isSameAs(classLoader).isNotSameAs(getClass().getClassLoader());
|
||||
assertThat(isolated.getClassLoader()) //
|
||||
.isSameAs(classLoader) //
|
||||
.isNotSameAs(getClass().getClassLoader());
|
||||
|
||||
assertThat(isolated).isNotEqualTo(included);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository.config;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -119,7 +120,7 @@ public class JpaRepositoryConfigExtensionUnitTests {
|
||||
JpaRepositoryConfigExtension extension = new JpaRepositoryConfigExtension();
|
||||
ClassLoader classLoader = extension.getConfigurationInspectionClassLoader(new GenericApplicationContext());
|
||||
|
||||
assertThat(classLoader, is(instanceOf(InspectionClassLoader.class)));
|
||||
assertThat(classLoader).isInstanceOf(InspectionClassLoader.class);
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1250
|
||||
@@ -144,7 +145,7 @@ public class JpaRepositoryConfigExtensionUnitTests {
|
||||
JpaRepositoryConfigExtension extension = new JpaRepositoryConfigExtension();
|
||||
ClassLoader classLoader = extension.getConfigurationInspectionClassLoader(context);
|
||||
|
||||
assertThat(classLoader, is(not(instanceOf(InspectionClassLoader.class))));
|
||||
assertThat(classLoader).isNotInstanceOf(InspectionClassLoader.class);
|
||||
}
|
||||
|
||||
private void assertOnlyOnePersistenceAnnotationBeanPostProcessorRegistered(DefaultListableBeanFactory factory,
|
||||
|
||||
Reference in New Issue
Block a user