Skip to content

Commit 7c42d4a

Browse files
kinowmr-c
authored andcommitted
Use random port to avoid issues running tests in parallel when using MongoDB
1 parent ff40e6c commit 7c42d4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/java/org/commonwl/view/workflow/QueuedWorkflowRepositoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
import org.commonwl.view.git.GitDetails;
77
import org.junit.jupiter.api.Test;
88
import org.springframework.beans.factory.annotation.Autowired;
9-
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
109
import org.springframework.boot.test.context.SpringBootTest;
11-
import org.springframework.test.context.ActiveProfiles;
12-
import org.springframework.test.context.ContextConfiguration;
1310

1411
import static org.junit.jupiter.api.Assertions.assertNotNull;
1512
import static org.junit.jupiter.api.Assertions.assertNull;
1613

1714
// N.B. "To use embedded mongo, the spring.mongodb.embedded.version property must now be set."
1815
// https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.6-Release-Notes#embedded-mongo
1916
@SpringBootTest(
20-
properties={"spring.mongodb.embedded.version=3.2.2"},
17+
properties={
18+
"spring.mongodb.embedded.version=3.2.2",
19+
"spring.data.mongodb.port=0"
20+
},
2121
classes={MongoConfig.class, WebConfig.class, CwlViewerApplication.class, QueuedWorkflowRepository.class}
2222
)
2323
public class QueuedWorkflowRepositoryTest {

0 commit comments

Comments
 (0)