FINERACT-2304 - fix entity manager usage only through persistence context annotation

This commit is contained in:
mark.vituska
2025-05-29 13:52:49 +02:00
committed by Adam Saghy
parent d71c0bd204
commit 96d6099cc1
12 changed files with 40 additions and 17 deletions
@@ -28,9 +28,9 @@ import jakarta.persistence.EntityManager;
import org.apache.fineract.infrastructure.event.external.exception.ExternalEventConfigurationNotFoundException;
import org.apache.fineract.infrastructure.event.external.repository.CustomExternalEventConfigurationRepositoryImpl;
import org.apache.fineract.infrastructure.event.external.repository.domain.ExternalEventConfiguration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
@@ -41,13 +41,9 @@ public class CustomExternalEventConfigurationRepositoryImplTest {
@Mock
private EntityManager entityManager;
@InjectMocks
private CustomExternalEventConfigurationRepositoryImpl underTest;
@BeforeEach
public void setUp() {
underTest = new CustomExternalEventConfigurationRepositoryImpl(entityManager);
}
@Test
public void givenConfigurationExistsThenReturnConfiguration() {
// given