Switch from an in-memory HSQLDB to MariaDB during integration tests #57

Merged
ansv7779 merged 9 commits from testcontainers into develop 2024-12-16 13:55:34 +01:00
Showing only changes of commit 5996421aa0 - Show all commits

View File

@ -13,6 +13,7 @@ import org.hamcrest.TypeSafeMatcher;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import se.su.dsv.scipro.file.FileDescription; import se.su.dsv.scipro.file.FileDescription;
import se.su.dsv.scipro.file.FileReference; import se.su.dsv.scipro.file.FileReference;
import se.su.dsv.scipro.system.User;
import se.su.dsv.scipro.test.SpringTest; import se.su.dsv.scipro.test.SpringTest;
public class UrkundSubmissionRepositoryTest extends SpringTest { public class UrkundSubmissionRepositoryTest extends SpringTest {
@ -23,11 +24,14 @@ public class UrkundSubmissionRepositoryTest extends SpringTest {
@Test @Test
public void save() { public void save() {
final Instant submitted = Instant.now(); final Instant submitted = Instant.now();
User bob = User.builder().firstName("Bob").lastName("Sponge").emailAddress("bob@example.com").build();
save(bob);
final UrkundSubmission submission = new UrkundSubmission(); final UrkundSubmission submission = new UrkundSubmission();
submission.setState(UrkundSubmission.State.SUBMITTED); submission.setState(UrkundSubmission.State.SUBMITTED);
submission.setMessage("Hi"); submission.setMessage("Hi");
submission.setSubmitted(submitted); submission.setSubmitted(submitted);
submission.setNextPoll(submitted); submission.setNextPoll(submitted);
submission.setReceiver(bob);
final FileDescription file = save(new FileDescription()); final FileDescription file = save(new FileDescription());
final FileReference fileReference = new FileReference(); final FileReference fileReference = new FileReference();
fileReference.setFileDescription(file); fileReference.setFileDescription(file);