|
|
|
|
@ -43,12 +43,15 @@ import static org.mockito.BDDMockito.then;
@@ -43,12 +43,15 @@ import static org.mockito.BDDMockito.then;
|
|
|
|
|
class TestEntityManagerTests { |
|
|
|
|
|
|
|
|
|
@Mock |
|
|
|
|
@SuppressWarnings("NullAway.Init") |
|
|
|
|
private EntityManagerFactory entityManagerFactory; |
|
|
|
|
|
|
|
|
|
@Mock |
|
|
|
|
@SuppressWarnings("NullAway.Init") |
|
|
|
|
private EntityManager entityManager; |
|
|
|
|
|
|
|
|
|
@Mock |
|
|
|
|
@SuppressWarnings("NullAway.Init") |
|
|
|
|
private PersistenceUnitUtil persistenceUnitUtil; |
|
|
|
|
|
|
|
|
|
private TestEntityManager testEntityManager; |
|
|
|
|
@ -59,6 +62,7 @@ class TestEntityManagerTests {
@@ -59,6 +62,7 @@ class TestEntityManagerTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@SuppressWarnings("NullAway") // Test null check
|
|
|
|
|
void createWhenEntityManagerIsNullShouldThrowException() { |
|
|
|
|
assertThatIllegalArgumentException().isThrownBy(() -> new TestEntityManager(null)) |
|
|
|
|
.withMessageContaining("'entityManagerFactory' must not be null"); |
|
|
|
|
|