Skip to content

Commit 20de383

Browse files
committed
example fixes
1 parent 9df8d0e commit 20de383

36 files changed

Lines changed: 112 additions & 89 deletions

File tree

.github/workflows/examples_test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ jobs:
7373
- name: Start BaSyx Dynamic RBAC Example
7474
run: docker compose -f examples/BaSyxDynamicRBAC/docker-compose.yaml up -d
7575

76+
- name: Show BaSyx Dynamic RBAC Example Logs
77+
if: failure()
78+
run: docker compose -f examples/BaSyxDynamicRBAC/docker-compose.yaml logs --no-color
79+
7680
- name: Stop BaSyx Dynamic RBAC Example
81+
if: always()
7782
run: docker compose -f examples/BaSyxDynamicRBAC/docker-compose.yaml down
7883

7984
test-basyx-kafka:
@@ -111,7 +116,12 @@ jobs:
111116
- name: Start BaSyx Minimal Example
112117
run: docker compose -f examples/BaSyxMinimal/docker-compose.yml up -d
113118

119+
- name: Show BaSyx Minimal Example Logs
120+
if: failure()
121+
run: docker compose -f examples/BaSyxMinimal/docker-compose.yml logs --no-color
122+
114123
- name: Stop BaSyx Minimal Example
124+
if: always()
115125
run: docker compose -f examples/BaSyxMinimal/docker-compose.yml down
116126

117127
test-basyx-reverse-proxy:
@@ -206,7 +216,12 @@ jobs:
206216
- name: Start BaSyx Query Language Example
207217
run: docker compose -f examples/BaSyxQueryLanguage/docker-compose.yml up -d
208218

219+
- name: Show BaSyx Query Language Example Logs
220+
if: failure()
221+
run: docker compose -f examples/BaSyxQueryLanguage/docker-compose.yml logs --no-color
222+
209223
- name: Stop BaSyx Query Language Example
224+
if: always()
210225
run: docker compose -f examples/BaSyxQueryLanguage/docker-compose.yml down
211226

212227
test-basyx-cad:

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/feature/authorization/AuthorizedAasDiscoveryServiceSuite.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public abstract class AuthorizedAasDiscoveryServiceSuite {
7272
private static final String AASID2_ENCODED = Base64UrlEncoder.encode(AASID2);
7373
private static final String ASSETLINKS_SET1_PATH = "authorization/AssetLinks_Set1.json";
7474
private static final String ASSETLINKS_SET2_PATH = "authorization/AssetLinks_Set2.json";
75-
private static final String HEALTHOUTPUT_PATH = "authorization/HealthOutput.json";
7675

7776
protected abstract ConfigurableApplicationContext getAppContext();
7877
protected abstract AasDiscoveryService getUnauthDiscoveryService();
@@ -99,12 +98,10 @@ public void reset() throws Exception {
9998

10099
@Test
101100
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
102-
String expectedHealthEndpointOutput = getStringFromFile(HEALTHOUTPUT_PATH);
103-
104101
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(Endpoints.healthEndpoint());
105102
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
106103

107-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
104+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
108105
}
109106

110107
@Test

basyx.aasenvironment/basyx.aasenvironment-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/feature/authorization/TestAuthorizedAasEnvironmentSerialization.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,10 @@ public void reset() throws FileNotFoundException, IOException {
118118

119119
@Test
120120
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
121-
String expectedHealthEndpointOutput = getStringFromFile("authorization/HealthOutput.json");
122-
123121
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(healthEndpointUrl);
124122
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
125123

126-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
124+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
127125
}
128126

129127
@Test

basyx.aasenvironment/basyx.aasenvironment-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/feature/authorization/TestAuthorizedAasEnvironmentUpload.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ public static void shutDown(){
111111

112112
@Test
113113
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
114-
String expectedHealthEndpointOutput = getStringFromFile("authorization/HealthOutput.json");
115-
116114
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(healthEndpointUrl);
117115
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
118116

119-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
117+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
120118
}
121119

122120
@Test

basyx.aasenvironment/basyx.aasenvironment.component/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@
180180
<dependency>
181181
<groupId>org.apache.httpcomponents.client5</groupId>
182182
<artifactId>httpclient5</artifactId>
183-
<scope>test</scope>
184183
</dependency>
185184
<dependency>
186185
<groupId>org.springframework.boot</groupId>

basyx.aasregistry/basyx.aasregistry-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasregistry/regression/feature/authorization/TestAuthorizedAasRegistry.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,12 @@ public void reset() throws FileNotFoundException, IOException {
116116

117117
@Test
118118
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
119-
String expectedHealthEndpointOutput = getStringFromFile("authorization/HealthOutput.json");
120-
121119
String healthEndpointUrl = BASE_URL + "/actuator/health";
122120

123121
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(healthEndpointUrl);
124122
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
125123

126-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
124+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
127125
}
128126

129127
@Test

basyx.aasregistry/basyx.aasregistry-feature-search/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
<artifactId>elasticsearch-java</artifactId>
2828
<version>9.2.2</version>
2929
</dependency>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-elasticsearch</artifactId>
33+
</dependency>
3034
<dependency>
3135
<groupId>com.fasterxml.jackson.core</groupId>
3236
<artifactId>jackson-core</artifactId>
@@ -62,4 +66,4 @@
6266
</dependency>
6367
</dependencies>
6468

65-
</project>
69+
</project>

basyx.aasregistry/basyx.aasregistry-plugins/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111

1212
<packaging>maven-plugin</packaging>
1313
<properties></properties>
14+
<build>
15+
<plugins>
16+
<plugin>
17+
<groupId>org.apache.maven.plugins</groupId>
18+
<artifactId>maven-plugin-plugin</artifactId>
19+
<executions>
20+
<execution>
21+
<id>descriptor</id>
22+
<phase>compile</phase>
23+
<goals>
24+
<goal>descriptor</goal>
25+
</goals>
26+
</execution>
27+
</executions>
28+
</plugin>
29+
</plugins>
30+
</build>
1431
<dependencies>
1532
<dependency>
1633
<groupId>org.yaml</groupId>

basyx.aasregistry/basyx.aasregistry-service-basetests/src/main/java/org/eclipse/digitaltwin/basyx/aasregistry/service/tests/integration/AuthorizedAasRegistryTestSuite.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,12 @@ public void reset() throws IOException {
106106

107107
@Test
108108
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
109-
110-
111-
String expectedHealthEndpointOutput = getStringFromFile("authorization/HealthOutput.json");
112-
113109
String healthEndpointUrl = BASE_URL + "/actuator/health";
114110

115111
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(healthEndpointUrl);
116112
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
117113

118-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
114+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
119115
}
120116

121117
@Test

basyx.aasrepository/basyx.aasrepository-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/authorization/TestAuthorizedAasRepository.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ public static void tearDown() {
106106

107107
@Test
108108
public void healthEndpointWithoutAuthorization() throws IOException, ParseException {
109-
String expectedHealthEndpointOutput = getAasJSONString("authorization/HealthOutput.json");
110-
111109
CloseableHttpResponse healthCheckResponse = BaSyxHttpTestUtils.executeGetOnURL(healthEndpointUrl);
112110
assertEquals(HttpStatus.OK.value(), healthCheckResponse.getCode());
113111

114-
BaSyxHttpTestUtils.assertSameJSONContent(expectedHealthEndpointOutput, BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse));
112+
BaSyxHttpTestUtils.assertJSONValueEquals(BaSyxHttpTestUtils.getResponseAsString(healthCheckResponse), "/status", "UP");
115113
}
116114

117115
@Test

0 commit comments

Comments
 (0)