use test database
This commit is contained in:
parent
182417d240
commit
9e19bf1d10
@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
@ -170,18 +171,19 @@ public class ImportBusinessPartners extends ContextBasedTest {
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
@Transactional
|
||||
void persistEntities() {
|
||||
jpaAttempt.transacted(() -> {
|
||||
context("superuser-alex@hostsharing.net"); // TODO: use real user
|
||||
context("superuser-alex@hostsharing.net"); // TODO: use real user for actual import
|
||||
|
||||
contacts.forEach((id, contact) -> em.persist(contact));
|
||||
persons.forEach((id, person) -> em.persist(person));
|
||||
partners.forEach((id, partner) -> em.persist(partner));
|
||||
debitors.forEach((id, debitor) -> em.persist(debitor));
|
||||
memberships.forEach((id, membership) -> em.persist(membership));
|
||||
bankAccounts.forEach((id, account) -> em.persist(account));
|
||||
sepaMandates.forEach((id, mandate) -> em.persist(mandate));
|
||||
}).assertSuccessful();
|
||||
contacts.forEach((id, contact) -> em.persist(contact));
|
||||
persons.forEach((id, person) -> em.persist(person));
|
||||
partners.forEach((id, partner) -> em.persist(partner));
|
||||
debitors.forEach((id, debitor) -> em.persist(debitor));
|
||||
memberships.forEach((id, membership) -> em.persist(membership));
|
||||
bankAccounts.forEach((id, account) -> em.persist(account));
|
||||
sepaMandates.forEach((id, mandate) -> em.persist(mandate));
|
||||
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public List<String[]> readAllLines(Reader reader) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user