Skip to content

Commit

Permalink
CQI-14: Disable demo data loading for integration tests (#12)
Browse files Browse the repository at this point in the history
* CQI-14: Disable demo data loading for integration tests

Demo data was previously being loaded before the tests were run, so they were affected by records fetched from a csv.

* CQI-14: Added missing curly brace
  • Loading branch information
anawrotsoldevelo committed Feb 1, 2024
1 parent f3db857 commit a715d13
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test")
@ActiveProfiles({"test", "test-run"})
@SpringBootTest(properties = "spring.main.allow-bean-definition-overriding=true")
public class ExposedMessageSourceIntegrationTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@RunWith(SpringRunner.class)
@SpringBootTest(properties = "spring.main.allow-bean-definition-overriding=true")
@ActiveProfiles("test")
@ActiveProfiles({"test", "test-run"})
@Transactional
public abstract class BaseCrudRepositoryIntegrationTest<T extends Identifiable> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "spring.main.allow-bean-definition-overriding=true")
@ActiveProfiles("test")
@ActiveProfiles({"test", "test-run"})
@DirtiesContext
public abstract class BaseWebIntegrationTest {
private static final String BASE_URL = System.getenv("BASE_URL");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/openlmis/auth/TestDataInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.springframework.stereotype.Component;

@Component
@Profile("demo-data")
@Profile("demo-data & !test-run")
@Order(5)
public class TestDataInitializer implements CommandLineRunner {

Expand Down

0 comments on commit a715d13

Please sign in to comment.