Skip to content

Commit a11c1ee

Browse files
FriedJannikCopilot
andauthored
Adds BaSyx Profile to all Components (#952)
* Adds BaSyx SSP001 Profile to all Components * Update basyx.aasregistry/basyx.aasregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/aasregistry/service/api/BasyxDescriptionApiDelegate.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update basyx.aasregistry/basyx.aasregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/aasregistry/service/api/BasyxDescriptionApiDelegate.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/description/Profile.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update basyx.submodelregistry/basyx.submodelregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/api/BasyxDescriptionApiDelegate.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adapts Tests * Adapts Tests * Adapts Tests --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 2b17672 commit a11c1ee

14 files changed

Lines changed: 73 additions & 13 deletions

File tree

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/AasDiscoveryServiceDescriptionConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
public class AasDiscoveryServiceDescriptionConfiguration {
1313
@Bean
1414
public ProfileDeclaration aasDiscoveryProfiles() {
15-
return () -> new TreeSet<>(List.of(Profile.DISCOVERYSERVICESPECIFICATION_SSP_001));
15+
return () -> new TreeSet<>(List.of(Profile.DISCOVERYSERVICESPECIFICATION_SSP_001, Profile.BASYXSERVICESPECIFICATION_SSP_001));
1616
}
1717
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ public void whenGetDescription_thenDescriptionIsReturned() throws ApiException {
170170
ApiResponse<ServiceDescription> entity = api.getDescriptionWithHttpInfo();
171171
assertThat(entity.getStatusCode()).isEqualTo(OK);
172172
List<ProfilesEnum> profiles = entity.getData().getProfiles();
173-
assertThat(profiles).asList().hasSize(1);
174-
assertThat(profiles).asList().containsExactlyInAnyOrder(ProfilesEnum.ASSETADMINISTRATIONSHELLREGISTRYSERVICESPECIFICATION_SSP_001);
173+
assertThat(profiles).asList().hasSize(2);
174+
assertThat(profiles).asList().containsExactlyInAnyOrder(ProfilesEnum.ASSETADMINISTRATIONSHELLREGISTRYSERVICESPECIFICATION_SSP_001, ProfilesEnum.BASYXSERVICESPECIFICATION_SSP_001);
175175
}
176176

177177
@Test

basyx.aasregistry/basyx.aasregistry-service/src/main/java/org/eclipse/digitaltwin/basyx/aasregistry/service/api/BasyxDescriptionApiDelegate.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public void setValues(@Value("${description.profiles}") String[] profiles) {
4848
ProfilesEnum value = getProfile(eachProfile);
4949
profilesList.add(value);
5050
}
51+
if (!profilesList.contains(ProfilesEnum.BASYXSERVICESPECIFICATION_SSP_001)) {
52+
profilesList.add(ProfilesEnum.BASYXSERVICESPECIFICATION_SSP_001);
53+
}
5154
description.setProfiles(profilesList);
5255
}
5356

basyx.aasregistry/basyx.aasregistry-service/src/test/java/org/eclipse/digitaltwin/basyx/aasregistry/service/tests/DescriptionProfilesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
@RunWith(SpringRunner.class)
5656
@WebMvcTest(DescriptionApiController.class)
5757
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
58-
@TestPropertySource(properties = { "description.profiles=https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001,https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-001" })
58+
@TestPropertySource(properties = { "description.profiles=https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001,https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-001,https://basyx.org/aas/API/3/0/BaSyxServiceSpecification/SSP-001" })
5959
public class DescriptionProfilesTest {
6060

6161
@MockBean

basyx.aasregistry/open-api/patch-base-extensions.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,32 @@
188188
value: date-time
189189
## alter ServiceDescription
190190
- op: remove
191-
path: /components/schemas/ServiceDescription/example
191+
path: /components/schemas/ServiceDescription/example
192+
- op: add
193+
path: /components/schemas/ServiceDescription/properties/profiles/items/enum/-
194+
value: https://basyx.org/aas/API/3/0/BaSyxServiceSpecification/SSP-001
195+
- op: add
196+
path: /components/schemas/ServiceDescription/properties/profiles/items/x-enum-varnames
197+
value:
198+
- ASSETADMINISTRATIONSHELLSERVICESPECIFICATION_SSP_001
199+
- ASSETADMINISTRATIONSHELLSERVICESPECIFICATION_SSP_002
200+
- SUBMODELSERVICESPECIFICATION_SSP_001
201+
- SUBMODELSERVICESPECIFICATION_SSP_002
202+
- SUBMODELSERVICESPECIFICATION_SSP_003
203+
- AASXFILESERVERSERVICESPECIFICATION_SSP_001
204+
- ASSETADMINISTRATIONSHELLREGISTRYSERVICESPECIFICATION_SSP_001
205+
- ASSETADMINISTRATIONSHELLREGISTRYSERVICESPECIFICATION_SSP_002
206+
- SUBMODELREGISTRYSERVICESPECIFICATION_SSP_001
207+
- SUBMODELREGISTRYSERVICESPECIFICATION_SSP_002
208+
- DISCOVERYSERVICESPECIFICATION_SSP_001
209+
- ASSETADMINISTRATIONSHELLREPOSITORYSERVICESPECIFICATION_SSP_001
210+
- ASSETADMINISTRATIONSHELLREPOSITORYSERVICESPECIFICATION_SSP_002
211+
- SUBMODELREPOSITORYSERVICESPECIFICATION_SSP_001
212+
- SUBMODELREPOSITORYSERVICESPECIFICATION_SSP_002
213+
- SUBMODELREPOSITORYSERVICESPECIFICATION_SSP_003
214+
- SUBMODELREPOSITORYSERVICESPECIFICATION_SSP_004
215+
- CONCEPTDESCRIPTIONSERVICESPECIFICATION_SSP_001
216+
- BASYXSERVICESPECIFICATION_SSP_001
192217
## PagedResult_paging_metadata
193218
- op: remove
194219
path: /components/schemas/PagedResult_paging_metadata/properties/cursor/example

basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryServiceDescriptionConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public class AasRepositoryServiceDescriptionConfiguration {
1313
@Bean
1414
public ProfileDeclaration aasRepositoryProfiles() {
1515
return () -> new TreeSet<>(List.of(Profile.ASSETADMINISTRATIONSHELLREPOSITORYSERVICESPECIFICATION_SSP_001,
16-
Profile.ASSETADMINISTRATIONSHELLREPOSITORYSERVICESPECIFICATION_SSP_002));
16+
Profile.ASSETADMINISTRATIONSHELLREPOSITORYSERVICESPECIFICATION_SSP_002, Profile.BASYXSERVICESPECIFICATION_SSP_001));
1717
}
1818
}

basyx.aasxfileserver/basyx.aasxfileserver-http/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/http/AASXFileServerDescriptionConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
public class AASXFileServerDescriptionConfiguration {
1313
@Bean
1414
public ProfileDeclaration aasxFileServerProfiles() {
15-
return () -> new TreeSet<>(List.of(Profile.AASXFILESERVERSERVICESPECIFICATION_SSP_001));
15+
return () -> new TreeSet<>(List.of(Profile.AASXFILESERVERSERVICESPECIFICATION_SSP_001, Profile.BASYXSERVICESPECIFICATION_SSP_001));
1616
}
1717
}

basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/description/Profile.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public enum Profile implements StandardizedLiteralEnum {
5656
"https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-004"),
5757

5858
CONCEPTDESCRIPTIONSERVICESPECIFICATION_SSP_001(
59-
"https://admin-shell.io/aas/API/3/0/ConceptDescriptionServiceSpecification/SSP-001");
59+
"https://admin-shell.io/aas/API/3/0/ConceptDescriptionServiceSpecification/SSP-001"),
60+
61+
BASYXSERVICESPECIFICATION_SSP_001(
62+
"https://basyx.org/aas/API/3/0/BaSyxServiceSpecification/SSP-001"
63+
);
6064

6165
private String value;
6266

basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/conceptdescriptionrepository/http/ConceptDescriptionRepositoryServiceDescriptionConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
public class ConceptDescriptionRepositoryServiceDescriptionConfiguration {
1313
@Bean
1414
public ProfileDeclaration cdRepositoryProfiles() {
15-
return () -> new TreeSet<>(List.of(Profile.CONCEPTDESCRIPTIONSERVICESPECIFICATION_SSP_001));
15+
return () -> new TreeSet<>(List.of(Profile.CONCEPTDESCRIPTIONSERVICESPECIFICATION_SSP_001, Profile.BASYXSERVICESPECIFICATION_SSP_001));
1616
}
1717
}

basyx.submodelregistry/basyx.submodelregistry-service-basetests/src/main/java/org/eclipse/digitaltwin/basyx/submodelregistry/service/tests/integration/BaseIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public void whenGetDescription_thenDescriptionIsReturned() throws ApiException {
153153
ApiResponse<ServiceDescription> entity = api.getDescriptionWithHttpInfo();
154154
assertThat(entity.getStatusCode()).isEqualTo(OK);
155155
List<ProfilesEnum> profiles = entity.getData().getProfiles();
156-
assertThat(profiles).asList().hasSize(1);
157-
assertThat(profiles).asList().containsExactlyInAnyOrder(ProfilesEnum.SUBMODELREGISTRYSERVICESPECIFICATION_SSP_001);
156+
assertThat(profiles).asList().hasSize(2);
157+
assertThat(profiles).asList().containsExactlyInAnyOrder(ProfilesEnum.SUBMODELREGISTRYSERVICESPECIFICATION_SSP_001, ProfilesEnum.BASYXSERVICESPECIFICATION_SSP_001);
158158
}
159159

160160
@Test

0 commit comments

Comments
 (0)