-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bpdm-system-test): golden record tester module.
feat(bpdm-system-test): golden record tester module
- Loading branch information
1 parent
f5b6122
commit 2a5db4b
Showing
17 changed files
with
907 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>bpdm-parent</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>bpdm-system-tester</artifactId> | ||
<name>Business Partner Data Management System Tester</name> | ||
<description>Application to perform system tests for the BPDM system and golden record process</description> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<java.version>21</java.version> | ||
<kotlin.version>2.0.10</kotlin.version> | ||
<kotlinlogging.version>3.0.5</kotlinlogging.version> | ||
<cucumber.version>7.18.1</cucumber.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlinx</groupId> | ||
<artifactId>kotlinx-coroutines-core</artifactId> | ||
<version>1.8.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-reflect</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>bpdm-pool-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>bpdm-gate-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.github.microutils</groupId> | ||
<artifactId>kotlin-logging-jvm</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-java</artifactId> | ||
<version>7.14.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-junit</artifactId> | ||
<version>7.14.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-spring</artifactId> | ||
<version>7.14.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>bpdm-common-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<exclusions> | ||
<!-- in kotlin, use mockk instead of mockito --> | ||
<exclusion> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-junit-platform-engine</artifactId> | ||
<version>7.14.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
</project> |
45 changes: 45 additions & 0 deletions
45
bpdm-system-tester/src/main/kotlin/org/eclipse/tractusx/bpdm/test/system/Application.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.test.system | ||
|
||
import io.cucumber.junit.Cucumber | ||
import io.cucumber.junit.CucumberOptions | ||
import io.cucumber.spring.CucumberContextConfiguration | ||
import org.junit.runner.RunWith | ||
import org.springframework.boot.autoconfigure.SpringBootApplication | ||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration | ||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan | ||
import org.springframework.boot.test.context.SpringBootTest | ||
|
||
@RunWith(Cucumber::class) | ||
@CucumberOptions(features = ["bpdm-system-tester/src/main/resources"], glue = ["org.eclipse.tractusx.bpdm.test.system.stepdefinations"]) | ||
class CucumberTestRunConfiguration | ||
|
||
@CucumberContextConfiguration | ||
@SpringBootTest | ||
class SpringTestRunConfiguration | ||
|
||
@SpringBootApplication(exclude=[DataSourceAutoConfiguration::class]) | ||
@ConfigurationPropertiesScan | ||
class SpringApplicationConfiguration | ||
|
||
fun main(args: Array<String>) { | ||
io.cucumber.core.cli.Main.main(*args) | ||
} |
54 changes: 54 additions & 0 deletions
54
...m-tester/src/main/kotlin/org/eclipse/tractusx/bpdm/test/system/config/GateClientConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.test.system.config | ||
|
||
import org.eclipse.tractusx.bpdm.common.util.BpdmClientProperties | ||
import org.eclipse.tractusx.bpdm.common.util.BpdmWebClientProvider | ||
import org.eclipse.tractusx.bpdm.common.util.ClientConfigurationProperties | ||
import org.eclipse.tractusx.bpdm.gate.api.client.GateClient | ||
import org.eclipse.tractusx.bpdm.gate.api.client.GateClientImpl | ||
import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties | ||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
|
||
@ConfigurationProperties(prefix = PoolClientConfigurationProperties.PREFIX) | ||
data class GateClientConfigProperties( | ||
override val baseUrl: String = "http://localhost:8081", | ||
val searchChangelogPageSize: Int = 100, | ||
override val securityEnabled: Boolean = false, | ||
override val registration: OAuth2ClientProperties.Registration, | ||
override val provider: OAuth2ClientProperties.Provider | ||
) : BpdmClientProperties { | ||
companion object { | ||
const val PREFIX = "${ClientConfigurationProperties.PREFIX}.gate" | ||
} | ||
|
||
override fun getId() = PREFIX | ||
} | ||
|
||
@Configuration | ||
class GateClientConfig{ | ||
|
||
@Bean | ||
fun gateClient(webClientProvider: BpdmWebClientProvider, properties: GateClientConfigProperties): GateClient { | ||
return GateClientImpl { webClientProvider.builder(properties).build() } | ||
} | ||
} |
Oops, something went wrong.