Skip to content

Commit

Permalink
Use pass-core-test-config artifact from pass-core for ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Nov 1, 2024
1 parent 32aa370 commit e92bc6b
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 35 deletions.
9 changes: 9 additions & 0 deletions pass-data-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
<version>${maven-model.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -158,6 +165,8 @@
<ignoredUnusedDeclaredDependency>ch.qos.logback:logback-classic</ignoredUnusedDeclaredDependency>
<!-- junit-jupiter is a module containing the junit api jars used directly -->
<ignoredUnusedDeclaredDependency>org.junit.jupiter:junit-jupiter</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
<ignoredNonTestScopedDependencies>
<ignoredNonTestScopedDependency>ch.qos.logback:logback-classic:</ignoredNonTestScopedDependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class JsonApiPassClientIT {

System.setProperty("pass.core.url", "http://localhost:8080");
System.setProperty("pass.core.user", "backend");
System.setProperty("pass.core.password", "backend");
System.setProperty("pass.core.password", "moo");

Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.WARN);
Expand All @@ -109,10 +109,15 @@ public class JsonApiPassClientIT {
@Container
private static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.withCreateContainerCmdModifier(cmd -> {
cmd.getHostConfig().withPortBindings(new PortBinding(Ports.Binding.bindPort(8080),
new ExposedPort(8080)));
Expand Down
6 changes: 6 additions & 0 deletions pass-deposit-services/deposit-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
properties = {
"pass.client.url=http://localhost:8080",
"pass.client.user=backend",
"pass.client.password=backend"
"pass.client.password=moo"
})
@Testcontainers
@DirtiesContext
Expand All @@ -95,11 +95,16 @@ public abstract class AbstractDepositSubmissionIT {
@Container
protected static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "backend"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "moo"))
.withExposedPorts(8080);

@Autowired protected SubmissionTestUtil submissionTestUtil;
Expand Down
2 changes: 2 additions & 0 deletions pass-deposit-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@
<!-- mockito-inline is needed to mock final classes -->
<ignoredUnusedDeclaredDependency>org.mockito:mockito-inline:</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>io.awspring.cloud:spring-cloud-aws-starter-s3:</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
<ignoredNonTestScopedDependencies>
<!-- junit-jupiter is a module containing the junit api jars used directly -->
Expand Down
8 changes: 8 additions & 0 deletions pass-grant-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@
<version>${maven-model.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -299,6 +305,8 @@
<ignoredUnusedDeclaredDependency>org.projectlombok:lombok:</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.mockito:mockito-inline:</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>com.oracle.database.jdbc::</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,16 @@ public abstract class AbstractIntegrationTest {
@Container
protected static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "backend"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "moo"))
.withExposedPorts(8080);

@SpyBean protected PassClient passClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pass.grant.update.ts.path=file:./src/test/resources/grant_update_timestamps
# pass-core properties
pass.client.url=http://localhost:8080/
pass.client.user=backend
pass.client.password=backend
pass.client.password=moo
7 changes: 7 additions & 0 deletions pass-journal-loader/pass-journal-loader-nih/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@
<version>${maven-model.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,22 @@ public class DepositIT {

System.setProperty("pass.core.url", "http://localhost:8080");
System.setProperty("pass.core.user", "backend");
System.setProperty("pass.core.password", "backend");
System.setProperty("pass.core.password", "moo");
}

@Container
private static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "backend"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "moo"))
.withCreateContainerCmdModifier(cmd -> {
cmd.getHostConfig().withPortBindings(new PortBinding(Ports.Binding.bindPort(8080),
new ExposedPort(8080)));
Expand Down
2 changes: 2 additions & 0 deletions pass-journal-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
<ignoredUnusedDeclaredDependencies>
<!-- junit-jupiter is a module containing the junit api jars used directly -->
<ignoredUnusedDeclaredDependency>org.junit.jupiter:junit-jupiter:</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
Expand Down
7 changes: 7 additions & 0 deletions pass-nihms-loader/nihms-data-harvest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
6 changes: 6 additions & 0 deletions pass-nihms-loader/nihms-data-transform-load/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
<version>${wiremock-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ public abstract class NihmsSubmissionEtlITBase {
@Container
protected static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "backend"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "moo"))
.withExposedPorts(8080);

@DynamicPropertySource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ pmc.entrez.service.url=http://localhost:9911/entrez/eutils/esummary.fcgi?db=pubm
# pass-core properties
pass.client.url=http://localhost:8080/
pass.client.user=backend
pass.client.password=backend
pass.client.password=moo
7 changes: 2 additions & 5 deletions pass-nihms-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<junit.jupiter.version>5.10.1</junit.jupiter.version>
<mockito.version>5.10.0</mockito.version>
<wiremock.version>3.3.1</wiremock.version>
<!-- Properties for integration tests -->
<pass.core.port>8080</pass.core.port>
<pass.core.url>http://localhost:8080</pass.core.url>
<pass.core.user>backend</pass.core.user>
<pass.core.password>backend</pass.core.password>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -218,6 +213,8 @@
<ignoredUnusedDeclaredDependency>ch.qos.logback:logback-classic:</ignoredUnusedDeclaredDependency>
<!-- slf4j is the API used in the code, jcl is used by a transitive dep -->
<ignoredUnusedDeclaredDependency>org.slf4j:jcl-over-slf4j:</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
<ignoredNonTestScopedDependencies>
<!-- junit-jupiter is a module containing the junit api jars used directly -->
Expand Down
9 changes: 9 additions & 0 deletions pass-notification-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-core-test-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -359,6 +366,8 @@
<ignoredUnusedDeclaredDependencies>
<!-- slf4j is the API used in the code, logback is the logging provider not used directly -->
<ignoredUnusedDeclaredDependency>ch.qos.logback:logback-classic:</ignoredUnusedDeclaredDependency>
<!-- Used by ITs via classpath -->
<ignoredUnusedDeclaredDependency>org.eclipse.pass:pass-core-test-config::</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
@TestPropertySource(properties = {
"pass.client.url=http://localhost:8080",
"pass.client.user=backend",
"pass.client.password=backend"
"pass.client.password=moo"
})
@Testcontainers
@DirtiesContext
Expand All @@ -90,11 +90,16 @@ public class NotificationServiceIT extends AbstractNotificationSpringIntegration
@Container
static final GenericContainer<?> PASS_CORE_CONTAINER = new GenericContainer<>(PASS_CORE_IMG)
.withCopyFileToContainer(
MountableFile.forHostPath("../pass-core-test-config/"),
"/tmp/pass-core-test-config/"
MountableFile.forClasspathResource("/saml2/"),
"/tmp/saml2/"
)
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/pass-core-test-config/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "backend"))
.withCopyFileToContainer(
MountableFile.forClasspathResource("/application-test.yml"),
"/tmp/application-test.yml"
)
.withEnv("PASS_SAML_PATH", "file:/tmp/")
.withEnv("PASS_CORE_JAVA_OPTS", "-Dspring.config.import=file:/tmp/application-test.yml")
.waitingFor(Wait.forHttp("/data/grant").forStatusCode(200).withBasicCredentials("backend", "moo"))
.withExposedPorts(8080);

@RegisterExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spring.jms.listener.auto-startup=false

pass.client.url=http://localhost:8080/
pass.client.user=backend
pass.client.password=backend
pass.client.password=moo

spring.mail.protocol=smtp
spring.mail.host=localhost
Expand Down

0 comments on commit e92bc6b

Please sign in to comment.