diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/inmemory/InMemoryAasDiscoveryService.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/inmemory/InMemoryAasDiscoveryService.java index 8e7d47172..7a06e5ff2 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/inmemory/InMemoryAasDiscoveryService.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/inmemory/InMemoryAasDiscoveryService.java @@ -34,7 +34,7 @@ import java.util.function.Function; import java.util.stream.Collectors; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.model.AssetLink; import org.eclipse.digitaltwin.basyx.core.exceptions.AssetLinkDoesNotExistException; @@ -85,16 +85,16 @@ public CursorResult> getAllAssetAdministrationShellIdsByAssetLink(P } @Override - public List getAllAssetLinksById(String shellIdentifier) { + public List getAllAssetLinksById(String shellIdentifier) { throwIfAssetLinkDoesNotExist(shellIdentifier); AssetLink assetLink = assetLinks.get(shellIdentifier); - return assetLink.getSpecificAssetIDs(); + return assetLink.getSpecificAssetIds(); } @Override - public List createAllAssetLinksById(String shellIdentifier, List assetIds) { + public List createAllAssetLinksById(String shellIdentifier, List assetIds) { throwIfAssetLinkExists(shellIdentifier); assetLinks.put(shellIdentifier, new AssetLink(shellIdentifier, assetIds)); @@ -126,7 +126,7 @@ private CursorResult> paginateList(PaginationInfo pInfo, List link.getSpecificAssetIDStrings() + .filter(link -> link.getSpecificAssetIdStrings() .contains(id)) .findFirst() .map(link -> link.getShellIdentifier()) diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/MongoDBAasDiscoveryService.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/MongoDBAasDiscoveryService.java index 2ece710a0..f981c74d5 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/MongoDBAasDiscoveryService.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/MongoDBAasDiscoveryService.java @@ -31,7 +31,7 @@ import java.util.function.Function; import java.util.stream.Collectors; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.model.AssetLink; import org.eclipse.digitaltwin.basyx.core.exceptions.AssetLinkDoesNotExistException; @@ -76,7 +76,7 @@ public CursorResult> getAllAssetAdministrationShellIdsByAssetLink(P List assetLinks = mongoTemplate.findAll(AssetLink.class, collectionName); Set shellIdentifiers = assetLinks.stream() - .filter(link -> containsMatchingAssetId(link.getSpecificAssetIDs(), assetIds)) + .filter(link -> containsMatchingAssetId(link.getSpecificAssetIds(), assetIds)) .map(AssetLink::getShellIdentifier) .collect(Collectors.toSet()); @@ -84,18 +84,18 @@ public CursorResult> getAllAssetAdministrationShellIdsByAssetLink(P } @Override - public List getAllAssetLinksById(String shellIdentifier) { + public List getAllAssetLinksById(String shellIdentifier) { AssetLink assetLink = mongoTemplate.findOne(new Query().addCriteria(Criteria.where(SHELL_IDENTIFIER) .is(shellIdentifier)), AssetLink.class, collectionName); if (assetLink == null) throw new AssetLinkDoesNotExistException(shellIdentifier); - return assetLink.getSpecificAssetIDs(); + return assetLink.getSpecificAssetIds(); } @Override - public List createAllAssetLinksById(String shellIdentifier, List assetIds) { + public List createAllAssetLinksById(String shellIdentifier, List assetIds) { Query query = new Query().addCriteria(Criteria.where(SHELL_IDENTIFIER) .is(shellIdentifier)); @@ -134,7 +134,7 @@ private CursorResult> paginateList(PaginationInfo pInfo, List containedSpecificAssetIds, List queryAssetIds) { + private boolean containsMatchingAssetId(List containedSpecificAssetIds, List queryAssetIds) { return queryAssetIds.stream() .anyMatch(queryAssetId -> containedSpecificAssetIds.stream() .anyMatch(containedAssetId -> containedAssetId.getValue() diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/TestMongoDBAasDiscoveryService.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/TestMongoDBAasDiscoveryService.java index 4fb204c24..46914fff1 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/TestMongoDBAasDiscoveryService.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/TestMongoDBAasDiscoveryService.java @@ -30,7 +30,7 @@ import java.util.Arrays; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryServiceSuite; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.model.AssetLink; @@ -77,23 +77,23 @@ public void assetLinkIsPersisted() { String dummyShellIdentifier = "DummyShellID"; - List expectedAssetIDs = createDummyAssetLinkOnDiscoveryService(dummyShellIdentifier, aasDiscoveryService); + List expectedAssetIDs = createDummyAssetLinkOnDiscoveryService(dummyShellIdentifier, aasDiscoveryService); - List actualAssetIDs = aasDiscoveryService.getAllAssetLinksById(dummyShellIdentifier); + List actualAssetIDs = aasDiscoveryService.getAllAssetLinksById(dummyShellIdentifier); assertEquals(expectedAssetIDs, actualAssetIDs); removeCreatedAssetLink(dummyShellIdentifier, aasDiscoveryService); } - private List createDummyAssetLinkOnDiscoveryService(String testShellIdentifier, AasDiscoveryService aasDiscoveryService) { + private List createDummyAssetLinkOnDiscoveryService(String testShellIdentifier, AasDiscoveryService aasDiscoveryService) { AssetLink assetLink = getSingleDummyAasAssetLink(testShellIdentifier); createAssetLink(assetLink, aasDiscoveryService); - SpecificAssetID specificAssetID_1 = createDummySpecificAssetID("TestAsset1", "TestAssetValue1"); - SpecificAssetID specificAssetID_2 = createDummySpecificAssetID("TestAsset2", "TestAssetValue2"); + SpecificAssetId specificAssetId_1 = createDummySpecificAssetId("TestAsset1", "TestAssetValue1"); + SpecificAssetId specificAssetId_2 = createDummySpecificAssetId("TestAsset2", "TestAssetValue2"); - return Arrays.asList(specificAssetID_1, specificAssetID_2); + return Arrays.asList(specificAssetId_1, specificAssetId_2); } private void removeCreatedAssetLink(String dummyShellIdentifier, AasDiscoveryService aasDiscoveryService) { diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryService.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryService.java index 172f47736..471b97dff 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryService.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryService.java @@ -27,7 +27,7 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.core.pagination.CursorResult; import org.eclipse.digitaltwin.basyx.core.pagination.PaginationInfo; @@ -55,7 +55,7 @@ public interface AasDiscoveryService { * @param aasIdentifier * @return a list of asset identifiers */ - public List getAllAssetLinksById(String shellIdentifier); + public List getAllAssetLinksById(String shellIdentifier); /** * Creates new asset identifier key-value-pairs linked to an Asset @@ -66,7 +66,7 @@ public interface AasDiscoveryService { * @param assetIds * @return a list of asset identifiers */ - public List createAllAssetLinksById(String shellIdentifier, List assetIds); + public List createAllAssetLinksById(String shellIdentifier, List assetIds); /** * Deletes all asset identifier key-value-pairs linked to an Asset diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/model/AssetLink.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/model/AssetLink.java index 021cbb7df..decf89734 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/model/AssetLink.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/model/AssetLink.java @@ -29,11 +29,11 @@ import java.util.stream.Collectors; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; /** * Represents the link between {@link AssetAdministrationShell} and - * {@link SpecificAssetID} + * {@link SpecificAssetId} * * @author danish * @@ -41,25 +41,25 @@ public class AssetLink { private String shellIdentifier; - private List specificAssetIDs; + private List specificAssetIds; - public AssetLink(String shellIdentifier, List specificAssetIDs) { + public AssetLink(String shellIdentifier, List specificAssetIds) { super(); this.shellIdentifier = shellIdentifier; - this.specificAssetIDs = specificAssetIDs; + this.specificAssetIds = specificAssetIds; } public String getShellIdentifier() { return shellIdentifier; } - public List getSpecificAssetIDs() { - return specificAssetIDs; + public List getSpecificAssetIds() { + return specificAssetIds; } - public List getSpecificAssetIDStrings() { - return specificAssetIDs.stream() - .map(SpecificAssetID::getValue) + public List getSpecificAssetIdStrings() { + return specificAssetIds.stream() + .map(SpecificAssetId::getValue) .collect(Collectors.toList()); } } diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryServiceSuite.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryServiceSuite.java index 7d6524eeb..23017c28a 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryServiceSuite.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/core/AasDiscoveryServiceSuite.java @@ -33,8 +33,8 @@ import java.util.Arrays; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.model.AssetLink; import org.eclipse.digitaltwin.basyx.core.exceptions.AssetLinkDoesNotExistException; import org.eclipse.digitaltwin.basyx.core.exceptions.CollidingAssetLinkException; @@ -82,11 +82,11 @@ public void getAllAssetLinksById() { assetLinks.stream() .forEach(assetLink -> createAssetLink(assetLink, discoveryService)); - List expectedResult = Arrays.asList(createDummySpecificAssetID("DummyAssetName3", "DummyAsset_3_Value"), createDummySpecificAssetID("DummyAssetName4", "DummyAsset_4_Value")); + List expectedResult = Arrays.asList(createDummySpecificAssetId("DummyAssetName3", "DummyAsset_3_Value"), createDummySpecificAssetId("DummyAssetName4", "DummyAsset_4_Value")); String shellIdentifier = "TestAasID2"; - List actualResult = discoveryService.getAllAssetLinksById(shellIdentifier); + List actualResult = discoveryService.getAllAssetLinksById(shellIdentifier); assertEquals(expectedResult.size(), actualResult.size()); assertEquals(expectedResult, actualResult); @@ -98,12 +98,12 @@ public void createAllAssetLinksById() { String shellIdentifier = "TestAasID3"; - List expectedAssetIds = Arrays.asList(createDummySpecificAssetID("DummyAssetName4", "DummyAsset_4_Value"), createDummySpecificAssetID("DummyAssetName5", "DummyAsset_5_Value")); + List expectedAssetIds = Arrays.asList(createDummySpecificAssetId("DummyAssetName4", "DummyAsset_4_Value"), createDummySpecificAssetId("DummyAssetName5", "DummyAsset_5_Value")); - List createdAssetIds = discoveryService.createAllAssetLinksById(shellIdentifier, expectedAssetIds); + List createdAssetIds = discoveryService.createAllAssetLinksById(shellIdentifier, expectedAssetIds); assertEquals(expectedAssetIds, createdAssetIds); - List actualAssetIds = discoveryService.getAllAssetLinksById(shellIdentifier); + List actualAssetIds = discoveryService.getAllAssetLinksById(shellIdentifier); assertEquals(expectedAssetIds.size(), actualAssetIds.size()); assertEquals(expectedAssetIds, actualAssetIds); @@ -153,29 +153,29 @@ public static List getMultipleDummyAasAssetLink() { String dummyShellIdentifier_1 = "TestAasID1"; String dummyShellIdentifier_2 = "TestAasID2"; - SpecificAssetID specificAssetID_1 = createDummySpecificAssetID("DummyAssetName1", "DummyAsset_1_Value"); - SpecificAssetID specificAssetID_2 = createDummySpecificAssetID("DummyAssetName2", "DummyAsset_2_Value"); + SpecificAssetId specificAssetId_1 = createDummySpecificAssetId("DummyAssetName1", "DummyAsset_1_Value"); + SpecificAssetId specificAssetId_2 = createDummySpecificAssetId("DummyAssetName2", "DummyAsset_2_Value"); - SpecificAssetID specificAssetID_3 = createDummySpecificAssetID("DummyAssetName3", "DummyAsset_3_Value"); - SpecificAssetID specificAssetID_4 = createDummySpecificAssetID("DummyAssetName4", "DummyAsset_4_Value"); + SpecificAssetId specificAssetId_3 = createDummySpecificAssetId("DummyAssetName3", "DummyAsset_3_Value"); + SpecificAssetId specificAssetId_4 = createDummySpecificAssetId("DummyAssetName4", "DummyAsset_4_Value"); - return Arrays.asList(new AssetLink(dummyShellIdentifier_1, Arrays.asList(specificAssetID_1, specificAssetID_2)), new AssetLink(dummyShellIdentifier_2, Arrays.asList(specificAssetID_3, specificAssetID_4))); + return Arrays.asList(new AssetLink(dummyShellIdentifier_1, Arrays.asList(specificAssetId_1, specificAssetId_2)), new AssetLink(dummyShellIdentifier_2, Arrays.asList(specificAssetId_3, specificAssetId_4))); } public static void createAssetLink(AssetLink assetLink, AasDiscoveryService aasDiscoveryService) { - aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIDs()); + aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIds()); } public static AssetLink getSingleDummyAasAssetLink(String shellId) { - SpecificAssetID specificAssetID_1 = createDummySpecificAssetID("TestAsset1", "TestAssetValue1"); - SpecificAssetID specificAssetID_2 = createDummySpecificAssetID("TestAsset2", "TestAssetValue2"); + SpecificAssetId specificAssetId_1 = createDummySpecificAssetId("TestAsset1", "TestAssetValue1"); + SpecificAssetId specificAssetId_2 = createDummySpecificAssetId("TestAsset2", "TestAssetValue2"); - return new AssetLink(shellId, Arrays.asList(specificAssetID_1, specificAssetID_2)); + return new AssetLink(shellId, Arrays.asList(specificAssetId_1, specificAssetId_2)); } - protected static SpecificAssetID createDummySpecificAssetID(String name, String value) { - return new DefaultSpecificAssetID.Builder().name(name) + protected static SpecificAssetId createDummySpecificAssetId(String name, String value) { + return new DefaultSpecificAssetId.Builder().name(name) .value(value) .build(); } diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApi.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApi.java index a37a98dd8..3b625a2bd 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApi.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApi.java @@ -38,7 +38,7 @@ import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.http.pagination.InlineResponse200; import org.eclipse.digitaltwin.basyx.http.Base64UrlEncodedIdentifier; import org.eclipse.digitaltwin.basyx.http.model.Result; @@ -85,7 +85,7 @@ ResponseEntity getAllAssetAdministrationShellIdsByAssetLink(@Parame @Operation(summary = "Returns a list of specific Asset identifiers based on an Asset Administration Shell id to edit discoverable content", description = "", tags={ "Asset Administration Shell Basic Discovery API" }) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Requested specific Asset identifiers", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = SpecificAssetID.class)))), + @ApiResponse(responseCode = "200", description = "Requested specific Asset identifiers", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = SpecificAssetId.class)))), @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Result.class))), @@ -93,12 +93,12 @@ ResponseEntity getAllAssetAdministrationShellIdsByAssetLink(@Parame @RequestMapping(value = "/lookup/shells/{aasIdentifier}", produces = { "application/json" }, method = RequestMethod.GET) - ResponseEntity> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier); + ResponseEntity> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier); @Operation(summary = "Creates specific Asset identifiers linked to an Asset Administration Shell to edit discoverable content", description = "", tags={ "Asset Administration Shell Basic Discovery API" }) @ApiResponses(value = { - @ApiResponse(responseCode = "201", description = "Specific Asset identifiers created successfully", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = SpecificAssetID.class)))), + @ApiResponse(responseCode = "201", description = "Specific Asset identifiers created successfully", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = SpecificAssetId.class)))), @ApiResponse(responseCode = "400", description = "Bad Request, e.g. the request parameters of the format of the request body is wrong.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Result.class))), @@ -111,7 +111,7 @@ ResponseEntity getAllAssetAdministrationShellIdsByAssetLink(@Parame produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.POST) - ResponseEntity> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier, @Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List body); + ResponseEntity> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier, @Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List body); } diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApiController.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApiController.java index f5d61308c..2bc8a1744 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApiController.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApiController.java @@ -29,7 +29,7 @@ import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.media.Schema; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService; import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.http.pagination.InlineResponse200; import org.eclipse.digitaltwin.basyx.core.pagination.CursorResult; @@ -90,16 +90,16 @@ public ResponseEntity getAllAssetAdministrationShellIdsByAssetLink( return new ResponseEntity(paginatedAasIds, HttpStatus.OK); } - public ResponseEntity> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) { - List assetLinks = aasDiscoveryService.getAllAssetLinksById(aasIdentifier.getIdentifier()); + public ResponseEntity> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) { + List assetLinks = aasDiscoveryService.getAllAssetLinksById(aasIdentifier.getIdentifier()); return new ResponseEntity<>(assetLinks, HttpStatus.OK); } - public ResponseEntity> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier,@Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List body) { - List assetIDs = aasDiscoveryService.createAllAssetLinksById(aasIdentifier.getIdentifier(), body); + public ResponseEntity> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier,@Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List body) { + List assetIDs = aasDiscoveryService.createAllAssetLinksById(aasIdentifier.getIdentifier(), body); - return new ResponseEntity>(assetIDs, HttpStatus.CREATED); + return new ResponseEntity>(assetIDs, HttpStatus.CREATED); } private List getDecodedAssetIds(List assetIds) { diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/TestAasDiscoveryServiceHTTP.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/TestAasDiscoveryServiceHTTP.java index d33d5b69f..7cf0b0355 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/TestAasDiscoveryServiceHTTP.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/TestAasDiscoveryServiceHTTP.java @@ -65,10 +65,10 @@ public void resetService() { private void resetAssetLink(AssetLink assetLink, AasDiscoveryService aasDiscoveryService) { try { - aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIDs()); + aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIds()); } catch (CollidingAssetLinkException e) { aasDiscoveryService.deleteAllAssetLinksById(assetLink.getShellIdentifier()); - aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIDs()); + aasDiscoveryService.createAllAssetLinksById(assetLink.getShellIdentifier(), assetLink.getSpecificAssetIds()); } } diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-tck/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/tck/AasDiscoveryServiceTestDefinedURL.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-tck/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/tck/AasDiscoveryServiceTestDefinedURL.java index fda8a7978..7d3c2e4c7 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-tck/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/tck/AasDiscoveryServiceTestDefinedURL.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-tck/src/test/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/tck/AasDiscoveryServiceTestDefinedURL.java @@ -67,7 +67,7 @@ private void createDummyAssetLinks() { private void createAssetLink(AssetLink assetLink) { try { - String specificAssetIdsJSON = gson.toJson(assetLink.getSpecificAssetIDs()); + String specificAssetIdsJSON = gson.toJson(assetLink.getSpecificAssetIds()); CloseableHttpResponse creationResponse = createAssetLinks(assetLink.getShellIdentifier(), specificAssetIdsJSON); if (creationResponse.getCode() != 409) { diff --git a/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/ConceptDescriptionIdCollector.java b/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/ConceptDescriptionIdCollector.java index 81559a0e6..8f83c731b 100644 --- a/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/ConceptDescriptionIdCollector.java +++ b/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/ConceptDescriptionIdCollector.java @@ -30,7 +30,7 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementWalkerVisitor; import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; @@ -50,7 +50,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; @@ -90,11 +90,11 @@ public void visit(HasSemantics hasSemantics) { hasSemantics.getSupplementalSemanticIds().forEach(this::visit); - if (hasSemantics.getSemanticID() == null) + if (hasSemantics.getSemanticId() == null) return; - visit(hasSemantics.getSemanticID()); - conceptDescriptionIds.addAll(getConceptDescriptionIds(hasSemantics.getSemanticID().getKeys())); + visit(hasSemantics.getSemanticId()); + conceptDescriptionIds.addAll(getConceptDescriptionIds(hasSemantics.getSemanticId().getKeys())); } @Override @@ -144,7 +144,7 @@ public void visit(Identifiable identifiable) { } @Override - public void visit(SpecificAssetID specificAssetId) { + public void visit(SpecificAssetId specificAssetId) { if (specificAssetId == null) { return; } diff --git a/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/base/DefaultAASEnvironmentSerialization.java b/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/base/DefaultAASEnvironmentSerialization.java index ef35ed6c4..80196a2ca 100644 --- a/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/base/DefaultAASEnvironmentSerialization.java +++ b/basyx.aasenvironment/basyx.aasenvironment-core/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/base/DefaultAASEnvironmentSerialization.java @@ -34,7 +34,6 @@ import javax.validation.Valid; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; @@ -66,8 +65,8 @@ public class DefaultAASEnvironmentSerialization implements AasEnvironmentSeriali private AasRepository aasRepository; private SubmodelRepository submodelRepository; private ConceptDescriptionRepository conceptDescriptionRepository; - private Serializer jsonSerializer = new JsonSerializer(); - private Serializer xmlSerializer = new XmlSerializer(); + private JsonSerializer jsonSerializer = new JsonSerializer(); + private XmlSerializer xmlSerializer = new XmlSerializer(); private AASXSerializer aasxSerializer = new AASXSerializer(); private MetamodelCloneCreator cloneCreator = new MetamodelCloneCreator(); diff --git a/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestAASEnvironmentSerialization.java b/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestAASEnvironmentSerialization.java index 4b95db435..12d6fa3d7 100644 --- a/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestAASEnvironmentSerialization.java +++ b/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestAASEnvironmentSerialization.java @@ -14,7 +14,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidOperationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; @@ -84,10 +83,10 @@ private static Collection createDummySubmodels() { private static Collection createDummyShells() { AssetAdministrationShell shell1 = new DefaultAssetAdministrationShell.Builder().id(AAS_TECHNICAL_DATA_ID).idShort(AAS_TECHNICAL_DATA_ID) - .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE).globalAssetID(SUBMODEL_TECHNICAL_DATA_ID).build()).build(); + .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE).globalAssetId(SUBMODEL_TECHNICAL_DATA_ID).build()).build(); AssetAdministrationShell shell2 = new DefaultAssetAdministrationShell.Builder().id(AAS_OPERATIONAL_DATA_ID).idShort(AAS_OPERATIONAL_DATA_ID) - .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE).globalAssetID(SUBMODEL_TECHNICAL_DATA_ID).build()).build(); + .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE).globalAssetId(SUBMODEL_TECHNICAL_DATA_ID).build()).build(); Collection shells = new ArrayList<>(); shells.add(shell1); shells.add(shell2); @@ -135,13 +134,13 @@ public void testAASEnviromentSerializationWithJSONExcludeCD() throws Serializati } public static void validateJSON(String actual, boolean includeConceptDescription) throws DeserializationException { - Deserializer jsonDeserializer = new JsonDeserializer(); + JsonDeserializer jsonDeserializer = new JsonDeserializer(); Environment aasEnvironment = jsonDeserializer.read(actual); checkAASEnvironment(aasEnvironment, includeConceptDescription); } public static void validateXml(String actual, boolean includeConceptDescription) throws DeserializationException { - Deserializer xmlDeserializer = new XmlDeserializer(); + XmlDeserializer xmlDeserializer = new XmlDeserializer(); Environment aasEnvironment = xmlDeserializer.read(actual); checkAASEnvironment(aasEnvironment, includeConceptDescription); diff --git a/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestConceptDescriptionIdCollector.java b/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestConceptDescriptionIdCollector.java index 16727a302..9b7f92c67 100644 --- a/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestConceptDescriptionIdCollector.java +++ b/basyx.aasenvironment/basyx.aasenvironment-core/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/TestConceptDescriptionIdCollector.java @@ -93,25 +93,25 @@ private DefaultKey createDefaultSubmodelKey(String submodelId) { private List createDummySMEs() { Property dummyProperty1 = new DefaultProperty.Builder().idShort("dummyProperty1IdShort") .value("dummyProperty1Value") - .semanticID(new DefaultReference.Builder().keys( + .semanticId(new DefaultReference.Builder().keys( new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION).value("dummyProperty1CDId").build()) .build()) .build(); Property dummyProperty2 = new DefaultProperty.Builder().idShort("dummyProperty2IdShort") .value("dummyProperty2Value") - .semanticID(new DefaultReference.Builder().keys( + .semanticId(new DefaultReference.Builder().keys( new DefaultKey.Builder().type(KeyTypes.CAPABILITY).value("dummyProperty2CapabilityId").build()) .build()) .build(); Property dummyProperty3 = new DefaultProperty.Builder().idShort("dummyProperty3IdShort") .value("dummyProperty3Value") - .semanticID(new DefaultReference.Builder().keys( + .semanticId(new DefaultReference.Builder().keys( new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION).value("dummyProperty3CDId").build()) .build()) .build(); SubmodelElementCollection dummySMC1 = new DefaultSubmodelElementCollection.Builder().idShort("dummySMC1IdShort") .value(dummyProperty3) - .semanticID(new DefaultReference.Builder().keys( + .semanticId(new DefaultReference.Builder().keys( new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION).value("dummySMC1CDId").build()) .build()) .build(); @@ -122,7 +122,7 @@ private List createDummySMEs() { private SubmodelElement createDummySMEWithoutCDSemantic() { return new DefaultProperty.Builder().idShort("dummyNoCDSemanticPropertyIdShort") .value("dummyNoCDSemanticPropertyValue") - .semanticID(new DefaultReference.Builder().keys( + .semanticId(new DefaultReference.Builder().keys( new DefaultKey.Builder().type(KeyTypes.BLOB).value("dummyNoCDSemanticPropertyBlobId").build()) .build()) .build(); diff --git a/basyx.aasenvironment/basyx.aasenvironment-http/src/test/java/org/eclipse/basyx/digitaltwin/aasenvironment/http/DummyAASEnvironmentComponent.java b/basyx.aasenvironment/basyx.aasenvironment-http/src/test/java/org/eclipse/basyx/digitaltwin/aasenvironment/http/DummyAASEnvironmentComponent.java index a03d29847..5357b1f0e 100644 --- a/basyx.aasenvironment/basyx.aasenvironment-http/src/test/java/org/eclipse/basyx/digitaltwin/aasenvironment/http/DummyAASEnvironmentComponent.java +++ b/basyx.aasenvironment/basyx.aasenvironment-http/src/test/java/org/eclipse/basyx/digitaltwin/aasenvironment/http/DummyAASEnvironmentComponent.java @@ -85,14 +85,14 @@ private Collection createDummyShells() { AssetAdministrationShell shell1 = new DefaultAssetAdministrationShell.Builder().id(AAS_TECHNICAL_DATA_ID) .idShort(AAS_TECHNICAL_DATA_ID) .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID(SUBMODEL_TECHNICAL_DATA_ID) + .globalAssetId(SUBMODEL_TECHNICAL_DATA_ID) .build()) .build(); AssetAdministrationShell shell2 = new DefaultAssetAdministrationShell.Builder().id(AAS_OPERATIONAL_DATA_ID) .idShort(AAS_OPERATIONAL_DATA_ID) .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID(AAS_OPERATIONAL_DATA_ID) + .globalAssetId(AAS_OPERATIONAL_DATA_ID) .build()) .build(); Collection shells = new ArrayList<>(); diff --git a/basyx.aasrepository/basyx.aasrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/AasRepositorySuite.java b/basyx.aasrepository/basyx.aasrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/AasRepositorySuite.java index 0b312aab2..48e585cb6 100644 --- a/basyx.aasrepository/basyx.aasrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/AasRepositorySuite.java +++ b/basyx.aasrepository/basyx.aasrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/AasRepositorySuite.java @@ -296,7 +296,7 @@ public static Reference createDummyReference(String submodelId) { private AssetInformation createDummyAssetInformation() { return new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID("assetIDTestKey") + .globalAssetId("assetIDTestKey") .build(); } diff --git a/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryApiHTTPController.java b/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryApiHTTPController.java index 4735e9189..b45989dce 100644 --- a/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryApiHTTPController.java +++ b/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryApiHTTPController.java @@ -33,7 +33,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasrepository.AasRepository; import org.eclipse.digitaltwin.basyx.aasrepository.http.pagination.GetAssetAdministrationShellsResult; import org.eclipse.digitaltwin.basyx.aasrepository.http.pagination.GetReferencesResult; @@ -99,7 +99,7 @@ public ResponseEntity deleteSubmodelReferenceByIdAasRepository(Base64UrlEn } @Override - public ResponseEntity getAllAssetAdministrationShells(@Valid List assetIds, @Valid String idShort, @Min(1) @Valid Integer limit, @Valid Base64UrlEncodedCursor cursor) { + public ResponseEntity getAllAssetAdministrationShells(@Valid List assetIds, @Valid String idShort, @Min(1) @Valid Integer limit, @Valid Base64UrlEncodedCursor cursor) { if (limit == null) limit = 100; diff --git a/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPApi.java b/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPApi.java index d796e6718..83c37ddff 100644 --- a/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPApi.java +++ b/basyx.aasrepository/basyx.aasrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/http/AasRepositoryHTTPApi.java @@ -39,7 +39,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.aasrepository.http.pagination.GetAssetAdministrationShellsResult; import org.eclipse.digitaltwin.basyx.aasrepository.http.pagination.GetReferencesResult; import org.eclipse.digitaltwin.basyx.http.Base64UrlEncodedIdentifier; @@ -116,7 +116,7 @@ ResponseEntity deleteSubmodelReferenceByIdAasRepository( @ApiResponse(responseCode = "200", description = "Default error handling for unmentioned status codes", content = @Content(mediaType = "application/json", schema = @Schema(implementation = PagedResult.class))) }) @RequestMapping(value = "/shells", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity getAllAssetAdministrationShells( - @Parameter(in = ParameterIn.QUERY, description = "A list of specific Asset identifiers", schema = @Schema()) @Valid @RequestParam(value = "assetIds", required = false) List assetIds, + @Parameter(in = ParameterIn.QUERY, description = "A list of specific Asset identifiers", schema = @Schema()) @Valid @RequestParam(value = "assetIds", required = false) List assetIds, @Parameter(in = ParameterIn.QUERY, description = "The Asset Administration Shell’s IdShort", schema = @Schema()) @Valid @RequestParam(value = "idShort", required = false) String idShort, @Min(1) @Parameter(in = ParameterIn.QUERY, description = "The maximum number of elements in the response array", schema = @Schema(allowableValues = { "1" }, minimum = "1")) @Valid @RequestParam(value = "limit", required = false) Integer limit, diff --git a/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/AasServiceSuite.java b/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/AasServiceSuite.java index d27117754..dc7c428cc 100644 --- a/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/AasServiceSuite.java +++ b/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/AasServiceSuite.java @@ -84,7 +84,7 @@ public void getSubmodelReference() { public void addSubmodelReference() { Submodel submodel = createDummySubmodel(); - aasService.addSubmodelReference(submodel.getSemanticID()); + aasService.addSubmodelReference(submodel.getSemanticId()); List submodelReferences = aasService.getSubmodelReferences(NO_LIMIT_PAGINATION_INFO).getResult(); @@ -122,7 +122,7 @@ public void setAssetInformation() { private AssetInformation createDummyAssetInformation() { AssetInformation assetInfo = new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID("assetIDTestKey") + .globalAssetId("assetIDTestKey") .build(); return assetInfo; } @@ -133,7 +133,7 @@ private Reference getFirstSubmodelReference(List submodelReferences) private DefaultSubmodel createDummySubmodel() { return new DefaultSubmodel.Builder() - .semanticID( + .semanticId( new DefaultReference.Builder().keys(new DefaultKey.Builder().value("testKey").build()).build()) .build(); } diff --git a/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/DummyAssetAdministrationShell.java b/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/DummyAssetAdministrationShell.java index 92044e2f1..9a4f9f8d3 100644 --- a/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/DummyAssetAdministrationShell.java +++ b/basyx.aasservice/basyx.aasservice-core/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/DummyAssetAdministrationShell.java @@ -26,7 +26,7 @@ public class DummyAssetAdministrationShell { public static AssetAdministrationShell getDummyShell() { return new DefaultAssetAdministrationShell.Builder().id("arbitrary") .assetInformation(new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID(SUBMODEL_ID).build()) + .globalAssetId(SUBMODEL_ID).build()) .build(); } diff --git a/basyx.aasservice/basyx.aasservice-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/feature/mqtt/TestMqttAasService.java b/basyx.aasservice/basyx.aasservice-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/feature/mqtt/TestMqttAasService.java index bdbe59fea..5cdab9cf6 100644 --- a/basyx.aasservice/basyx.aasservice-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/feature/mqtt/TestMqttAasService.java +++ b/basyx.aasservice/basyx.aasservice-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/aasservice/feature/mqtt/TestMqttAasService.java @@ -109,6 +109,7 @@ private static AasServiceFactory createMqttAasServiceFactory(MqttClient client) return mqttFeature.decorate(serviceFactory); } + @Override @Test public void setAssetInformation() { AssetInformation assetInfo = createDummyAssetInformation(); @@ -121,7 +122,7 @@ public void setAssetInformation() { private AssetInformation createDummyAssetInformation() { AssetInformation assetInfo = new DefaultAssetInformation.Builder().assetKind(AssetKind.INSTANCE) - .globalAssetID("assetIDTestKey") + .globalAssetId("assetIDTestKey") .build(); return assetInfo; } diff --git a/basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/Aas4JHTTPSerializationExtension.java b/basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/Aas4JHTTPSerializationExtension.java index f18fba647..d8a5afef9 100644 --- a/basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/Aas4JHTTPSerializationExtension.java +++ b/basyx.common/basyx.http/src/main/java/org/eclipse/digitaltwin/basyx/http/Aas4JHTTPSerializationExtension.java @@ -25,20 +25,21 @@ package org.eclipse.digitaltwin.basyx.http; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; -import com.fasterxml.jackson.databind.module.SimpleModule; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.ReflectionAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import org.eclipse.digitaltwin.basyx.core.StandardizedLiteralEnum; import org.eclipse.digitaltwin.basyx.http.description.Profile; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; +import com.fasterxml.jackson.databind.module.SimpleModule; + /** * SerializationExtension integrating the AAS4J serialization in BaSyx * diff --git a/basyx.submodelrepository/basyx.submodelrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/core/SubmodelRepositorySuite.java b/basyx.submodelrepository/basyx.submodelrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/core/SubmodelRepositorySuite.java index 3a1503dea..a6382b6d4 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/core/SubmodelRepositorySuite.java +++ b/basyx.submodelrepository/basyx.submodelrepository-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/core/SubmodelRepositorySuite.java @@ -40,7 +40,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; @@ -384,7 +384,7 @@ public void createSubmodelElement() { Property property = new DefaultProperty.Builder().idShort("test321") .category("cat1") .value("305") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); repo.createSubmodelElement(DummySubmodelFactory.SUBMODEL_SIMPLE_DATA_ID, property); @@ -411,12 +411,12 @@ public void createNestedSubmodelELement() { Property propertyInCollection = new DefaultProperty.Builder().idShort("test654") .category("cat1") .value("305") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); Property propertyInList = new DefaultProperty.Builder().idShort("test987") .category("cat1") .value("305") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); String idShortPathPropertyInSmeCol = DummySubmodelFactory.SUBMODEL_ELEMENT_COLLECTION_SIMPLE; @@ -527,7 +527,7 @@ private Submodel buildDummySubmodel(String id) { return new DefaultSubmodel.Builder().id(id) .submodelElements(new DefaultProperty.Builder().idShort("prop") .value("testValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build(); } diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http/SubmodelRepositoryHTTPSerializationExtension.java b/basyx.submodelrepository/basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http/SubmodelRepositoryHTTPSerializationExtension.java index 683d83c2e..a03ecd689 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http/SubmodelRepositoryHTTPSerializationExtension.java +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http/SubmodelRepositoryHTTPSerializationExtension.java @@ -27,12 +27,12 @@ import org.eclipse.digitaltwin.basyx.deserialization.SubmodelElementValueJsonDeserializer; import org.eclipse.digitaltwin.basyx.deserialization.ValueOnlyJsonDeserializer; -import org.eclipse.digitaltwin.basyx.deserialization.SpecificAssetIDValueJsonDeserializer; +import org.eclipse.digitaltwin.basyx.deserialization.SpecificAssetIdValueJsonDeserializer; import org.eclipse.digitaltwin.basyx.http.SerializationExtension; import org.eclipse.digitaltwin.basyx.mixins.ReferenceElementValueMixIn; import org.eclipse.digitaltwin.basyx.serialization.MultiLanguagePropertyValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.PropertyValueSerializer; -import org.eclipse.digitaltwin.basyx.serialization.SpecificAssetIDValueSerializer; +import org.eclipse.digitaltwin.basyx.serialization.SpecificAssetIdValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelElementCollectionValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelElementListValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelValueOnlySerializer; @@ -40,7 +40,7 @@ import org.eclipse.digitaltwin.basyx.submodelservice.value.MultiLanguagePropertyValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.PropertyValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.ReferenceElementValue; -import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIDValue; +import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIdValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementCollectionValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementListValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementValue; @@ -70,8 +70,8 @@ public void extend(Jackson2ObjectMapperBuilder builder) { builder.serializerByType(SubmodelElementListValue.class, new SubmodelElementListValueSerializer()); builder.mixIn(ReferenceElementValue.class, ReferenceElementValueMixIn.class); builder.serializerByType(SubmodelValueOnly.class, new SubmodelValueOnlySerializer()); - builder.deserializerByType(SpecificAssetIDValue.class, new SpecificAssetIDValueJsonDeserializer()); - builder.serializerByType(SpecificAssetIDValue.class, new SpecificAssetIDValueSerializer()); + builder.deserializerByType(SpecificAssetIdValue.class, new SpecificAssetIdValueJsonDeserializer()); + builder.serializerByType(SpecificAssetIdValue.class, new SpecificAssetIdValueSerializer()); } } diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/MultipleSubmodels.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/MultipleSubmodels.json index 3c1f6b33a..727b7472c 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/MultipleSubmodels.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/MultipleSubmodels.json @@ -4,6 +4,7 @@ { "modelType": "Submodel", "id": "7A7104BDAB57E184", + "kind":"Instance", "idShort": "TechnicalData", "submodelElements": [ { @@ -326,7 +327,7 @@ "modelType": "SubmodelElementList", "category": "PARAMETER", "idShort": "SubmodelElementList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Range", @@ -409,6 +410,7 @@ "id": "8A6344BDAB57E184", "idShort": "FileTests", "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [{ "type": "GlobalReference", @@ -450,6 +452,7 @@ }, { "modelType": "Submodel", + "kind":"Instance", "id": "AC69B1CB44F07935", "idShort": "OperationalData", "submodelElements": [ @@ -473,6 +476,7 @@ }, { "modelType": "Submodel", + "kind":"Instance", "id": "simpleSubmodel001", "idShort": "simpleSubmodel001", "submodelElements": [ @@ -492,7 +496,7 @@ { "modelType": "SubmodelElementList", "idShort": "SimpleList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Property", diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel.json index 8e1e34dfa..f7970c47c 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel.json @@ -2,6 +2,7 @@ "modelType": "Submodel", "id": "7A7104BDAB57E184", "idShort": "TechnicalData", + "kind":"Instance", "submodelElements": [ { "modelType": "Property", @@ -323,7 +324,7 @@ "modelType": "SubmodelElementList", "category": "PARAMETER", "idShort": "SubmodelElementList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Range", diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel4FileTest.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel4FileTest.json index 9b0585616..d0231074a 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel4FileTest.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodel4FileTest.json @@ -1,5 +1,6 @@ { "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [ { diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelMetadata.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelMetadata.json index 0d8a69e60..b5df0a2c9 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelMetadata.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelMetadata.json @@ -2,6 +2,7 @@ "modelType": "Submodel", "id": "7A7104BDAB57E184", "idShort": "TechnicalData", + "kind":"Instance", "semanticId": { "keys": [ { diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelNew.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelNew.json index 3347c1de9..82adee3cb 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelNew.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelNew.json @@ -1,5 +1,6 @@ { "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [ diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdate.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdate.json index 7f08d7805..e33d40893 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdate.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdate.json @@ -1,5 +1,6 @@ { "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [ diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdateMismatchId.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdateMismatchId.json index 5665cdff7..8aa079fb6 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdateMismatchId.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelUpdateMismatchId.json @@ -1,5 +1,6 @@ { "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [ diff --git a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SubmodelsPaginated.json b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SubmodelsPaginated.json index 8802a50b3..14f2f98b8 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SubmodelsPaginated.json +++ b/basyx.submodelrepository/basyx.submodelrepository-http/src/test/resources/SubmodelsPaginated.json @@ -5,6 +5,7 @@ "id": "8A6344BDAB57E184", "idShort": "FileTests", "modelType": "Submodel", + "kind":"Instance", "semanticId": { "keys": [{ "type": "GlobalReference", diff --git a/basyx.submodelservice/basyx.submodelservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/InMemorySubmodelService.java b/basyx.submodelservice/basyx.submodelservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/InMemorySubmodelService.java index 87af62974..2bb9deabe 100644 --- a/basyx.submodelservice/basyx.submodelservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/InMemorySubmodelService.java +++ b/basyx.submodelservice/basyx.submodelservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/InMemorySubmodelService.java @@ -25,7 +25,6 @@ package org.eclipse.digitaltwin.basyx.submodelservice; -import java.util.Collection; import java.util.List; import java.util.TreeMap; import java.util.stream.Collectors; @@ -143,7 +142,7 @@ public void createSubmodelElement(String idShortPath, SubmodelElement submodelEl } if (parentSme instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) parentSme; - Collection submodelElements = collection.getValue(); + List submodelElements = collection.getValue(); submodelElements.add(submodelElement); collection.setValue(submodelElements); return; diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIDValueJsonDeserializer.java b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIdValueJsonDeserializer.java similarity index 93% rename from basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIDValueJsonDeserializer.java rename to basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIdValueJsonDeserializer.java index d5472731c..8440afb1c 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIDValueJsonDeserializer.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/deserialization/SpecificAssetIdValueJsonDeserializer.java @@ -31,7 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.basyx.submodelservice.value.ReferenceValue; -import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIDValue; +import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIdValue; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -45,11 +45,11 @@ /** * @author jungjan, witt */ -public class SpecificAssetIDValueJsonDeserializer extends JsonDeserializer { +public class SpecificAssetIdValueJsonDeserializer extends JsonDeserializer { private final String EXTERNAL_SUBJECT_ID_KEY = "externalSubjectId"; @Override - public SpecificAssetIDValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public SpecificAssetIdValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { try { ObjectMapper mapper = (ObjectMapper) p.getCodec(); JsonNode node = mapper.readTree(p); @@ -66,7 +66,7 @@ public SpecificAssetIDValue deserialize(JsonParser p, DeserializationContext ctx externalSubjectIdValue = handleExternalSubjectId(mapper, node); } - return new SpecificAssetIDValue(name, value, externalSubjectIdValue); + return new SpecificAssetIdValue(name, value, externalSubjectIdValue); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIDValueSerializer.java b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIdValueSerializer.java similarity index 92% rename from basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIDValueSerializer.java rename to basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIdValueSerializer.java index a7251c241..58c09b832 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIDValueSerializer.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/serialization/SpecificAssetIdValueSerializer.java @@ -29,7 +29,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.basyx.submodelservice.value.ReferenceValue; -import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIDValue; +import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIdValue; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; @@ -38,10 +38,10 @@ /** * @author witt, jungjan */ -public class SpecificAssetIDValueSerializer extends JsonSerializer { +public class SpecificAssetIdValueSerializer extends JsonSerializer { @Override - public void serialize(SpecificAssetIDValue value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + public void serialize(SpecificAssetIdValue value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writePOJOField(value.getName(), value.getValue()); diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/EntityValue.java b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/EntityValue.java index 77e389e12..e47a5eeda 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/EntityValue.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/EntityValue.java @@ -40,7 +40,7 @@ public class EntityValue implements SubmodelElementValue { private List statements; private EntityType entityType; private Optional globalAssetId = Optional.empty(); - private Optional> specificAssetIds = Optional.empty(); + private Optional> specificAssetIds = Optional.empty(); @SuppressWarnings("unused") private EntityValue() { @@ -48,7 +48,7 @@ private EntityValue() { } public EntityValue(List statements, EntityType entityType, String globalAssetId, - List< SpecificAssetIDValue> specificAssetIds) { + List< SpecificAssetIdValue> specificAssetIds) { this.statements = statements; this.entityType = entityType; this.globalAssetId = Optional.ofNullable(globalAssetId); @@ -67,7 +67,7 @@ public String getGlobalAssetId() { return globalAssetId.orElse(null); } - public List getSpecificAssetIds() { + public List getSpecificAssetIds() { return specificAssetIds.orElse(null); } diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIDValue.java b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIdValue.java similarity index 78% rename from basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIDValue.java rename to basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIdValue.java index fa3bfe7bc..f376923d9 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIDValue.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/SpecificAssetIdValue.java @@ -27,8 +27,8 @@ package org.eclipse.digitaltwin.basyx.submodelservice.value; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; /** * Represents the {@link SpecificAssetId} value @@ -36,28 +36,28 @@ * @author danish * */ -public class SpecificAssetIDValue { +public class SpecificAssetIdValue { private String name; private String value; private ReferenceValue externalSubjectId; @SuppressWarnings("unused") - private SpecificAssetIDValue() { + private SpecificAssetIdValue() { super(); } - public SpecificAssetIDValue(String name, String value, ReferenceValue externalSubjectId) { + public SpecificAssetIdValue(String name, String value, ReferenceValue externalSubjectId) { this.name = name; this.value = value; this.externalSubjectId = externalSubjectId; } - public SpecificAssetIDValue(SpecificAssetID specificAssetID) { - this.name = specificAssetID.getName(); - this.value = specificAssetID.getValue(); - if (specificAssetID.getExternalSubjectID() != null) { - this.externalSubjectId = new ReferenceValue(specificAssetID.getExternalSubjectID()); + public SpecificAssetIdValue(SpecificAssetId specificAssetId) { + this.name = specificAssetId.getName(); + this.value = specificAssetId.getValue(); + if (specificAssetId.getExternalSubjectId() != null) { + this.externalSubjectId = new ReferenceValue(specificAssetId.getExternalSubjectId()); } } @@ -76,7 +76,7 @@ public Reference getExternalSubjectId() { return externalSubjectId.toReference(); } - public SpecificAssetID toSpecificAssetID() { - return new DefaultSpecificAssetID.Builder().externalSubjectID(getExternalSubjectId()).name(getName()).value(getValue()).build(); + public SpecificAssetId toSpecificAssetId() { + return new DefaultSpecificAssetId.Builder().externalSubjectId(getExternalSubjectId()).name(getName()).value(getValue()).build(); } } diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/mapper/EntityValueMapper.java b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/mapper/EntityValueMapper.java index 227263ade..d059b5ef7 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/mapper/EntityValueMapper.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/value/mapper/EntityValueMapper.java @@ -28,9 +28,9 @@ import java.util.stream.Collectors; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.basyx.submodelservice.value.EntityValue; -import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIDValue; +import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIdValue; /** * Maps {@link Entity} value to {@link EntityValue} @@ -47,30 +47,30 @@ public EntityValueMapper(Entity entity) { @Override public EntityValue getValue() { - return new EntityValue(ValueMapperUtil.createValueOnlyCollection(entity.getStatements()), entity.getEntityType(), entity.getGlobalAssetID(), getSpecificAssetIdValue(entity.getSpecificAssetIds())); + return new EntityValue(ValueMapperUtil.createValueOnlyCollection(entity.getStatements()), entity.getEntityType(), entity.getGlobalAssetId(), getSpecificAssetIdValue(entity.getSpecificAssetIds())); } @Override public void setValue(EntityValue entityValue) { ValueMapperUtil.setValueOfSubmodelElementWithValueOnly(entity.getStatements(), entityValue.getStatements()); entity.setEntityType(entityValue.getEntityType()); - setGlobalAssetID(entityValue.getGlobalAssetId()); - setSpecificAssetIDs(entityValue.getSpecificAssetIds()); + setGlobalAssetId(entityValue.getGlobalAssetId()); + setSpecificAssetIds(entityValue.getSpecificAssetIds()); } - private void setSpecificAssetIDs(List specificAssetIdValues) { + private void setSpecificAssetIds(List specificAssetIdValues) { if (specificAssetIdValues == null) return; - List specificAssetIds = specificAssetIdValues.stream().map(SpecificAssetIDValue::toSpecificAssetID).collect(Collectors.toList()); + List specificAssetIds = specificAssetIdValues.stream().map(SpecificAssetIdValue::toSpecificAssetId).collect(Collectors.toList()); entity.setSpecificAssetIds(specificAssetIds); } - private void setGlobalAssetID(String value) { - entity.setGlobalAssetID(value); + private void setGlobalAssetId(String value) { + entity.setGlobalAssetId(value); } - private List getSpecificAssetIdValue(List specificAssetIds) { - return specificAssetIds.stream().map(specificAssetId -> new SpecificAssetIDValue(specificAssetId)).collect(Collectors.toList()); + private List getSpecificAssetIdValue(List specificAssetIds) { + return specificAssetIds.stream().map(specificAssetId -> new SpecificAssetIdValue(specificAssetId)).collect(Collectors.toList()); } } diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/DummySubmodelFactory.java b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/DummySubmodelFactory.java index 15ebd1d82..a78315e88 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/DummySubmodelFactory.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/DummySubmodelFactory.java @@ -27,12 +27,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; import org.eclipse.digitaltwin.aas4j.v3.model.Property; @@ -123,7 +122,7 @@ public static Submodel createSubmodelWithAllSubmodelElements() { } public static Submodel createTechnicalDataSubmodel() { - return new DefaultSubmodel.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) + return new DefaultSubmodel.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -135,7 +134,7 @@ public static Submodel createTechnicalDataSubmodel() { } public static Submodel createSubmodelWithFileElement() { - return new DefaultSubmodel.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) + return new DefaultSubmodel.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -170,13 +169,13 @@ private static List getAllSubmodelElementsList() { private static List getOperationalDataSubmodelElements() { List submodelElements = new ArrayList<>(); submodelElements.add(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY).build()) .type(ReferenceTypes.EXTERNAL_REFERENCE).build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY).value(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build()); return submodelElements; } @@ -191,7 +190,7 @@ private static List createOperationalDataSubmodelElements() { SubmodelElementCollection submodelElementCollection = new DefaultSubmodelElementCollection(); SubmodelElementList submodelElementList = new DefaultSubmodelElementList(); - Collection submodelElementsCollection = new HashSet<>(); + List submodelElementsCollection = new ArrayList<>(); List submodelElementsList = new ArrayList<>(); setValuesOfSubmodelElements(sme2, sme3, submodelElementCollection, submodelElementList, submodelElementsCollection, submodelElementsList); @@ -206,7 +205,7 @@ private static List createOperationalDataSubmodelElements() { } private static void setValuesOfSubmodelElements(SubmodelElement sme2, SubmodelElement sme3, SubmodelElementCollection submodelElementCollection, SubmodelElementList submodelElementList, - Collection submodelElementsCollection, List submodelElementsList) { + List submodelElementsCollection, List submodelElementsList) { submodelElementList.setIdShort(SUBMODEL_OPERATIONAL_DATA_ELEMENT_LIST_ID_SHORT); submodelElementCollection.setIdShort(SUBMODEL_OPERATIONAL_DATA_ELEMENT_COLLECTION_ID_SHORT); submodelElementsList.add(sme2); @@ -221,10 +220,10 @@ private static SubmodelElementCollection createNestedElementCollection(SubmodelE SubmodelElementList submodelElementListInElementCollection = new DefaultSubmodelElementList(); SubmodelElementList submodelElementListInElementList = new DefaultSubmodelElementList(); SubmodelElementCollection submodelElementCollectionInElementList = new DefaultSubmodelElementCollection(); - Collection submodelElementCollectionInElementListCollection = new HashSet<>(); + List submodelElementCollectionInElementListCollection = new ArrayList<>(); List listForSubmodelElementListInElementList = new ArrayList<>(); List listForSubmodelElementListInElementCollection = new ArrayList<>(); - Collection collectionForTopLevelElementCollection = new HashSet<>(); + List collectionForTopLevelElementCollection = new ArrayList<>(); submodelElementCollectionInElementListCollection.add(sme2); submodelElementCollectionInElementList.setValue(submodelElementCollectionInElementListCollection); @@ -246,14 +245,14 @@ private static SubmodelElement createProperty(String propertyIdShort) { SubmodelElement sme3 = new DefaultProperty.Builder().idShort(propertyIdShort) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); return sme3; } private static List createSimpleSubmodelElements() { - ArrayList list = new ArrayList<>(); - Collection smeCollectionValue = new ArrayList<>(); + List list = new ArrayList<>(); + List smeCollectionValue = new ArrayList<>(); List smeListValue = new ArrayList<>(); SubmodelElementCollection smeCollection = new DefaultSubmodelElementCollection(); smeCollection.setIdShort(SUBMODEL_ELEMENT_COLLECTION_SIMPLE); diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceHelper.java b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceHelper.java index 2cdf24924..3ca6ca40a 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceHelper.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceHelper.java @@ -30,7 +30,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Blob; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -46,7 +46,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; @@ -64,7 +64,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import org.eclipse.digitaltwin.basyx.InvokableOperation; @@ -139,7 +139,7 @@ public class SubmodelServiceHelper { public static final String SUBMODEL_TECHNICAL_DATA_ENTITY_CATEGORY = "Entity"; public static final String SPECIFIC_ASSET_ID_VALUE = "specificValue"; public static final String SPECIFIC_ASSET_ID_NAME = "specificAssetIdName"; - private static final SpecificAssetID ENTITY_SPECIFIC_ASSET_ID = new DefaultSpecificAssetID.Builder().name(SPECIFIC_ASSET_ID_NAME) + private static final SpecificAssetId ENTITY_SPECIFIC_ASSET_ID = new DefaultSpecificAssetId.Builder().name(SPECIFIC_ASSET_ID_NAME) .value(SPECIFIC_ASSET_ID_VALUE) .build(); public static final String GLOBAL_ASSET_ID = "globalAssetID"; @@ -181,7 +181,7 @@ public static SubmodelElement getDummySubmodelElement(Submodel technicalData, St } public static Property createPropertySubmodelElement() { - return new DefaultProperty.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultProperty.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -189,12 +189,12 @@ public static Property createPropertySubmodelElement() { .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); } public static Range createRangeSubmodelElement() { - return new DefaultRange.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultRange.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_RANGE) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -202,14 +202,14 @@ public static Range createRangeSubmodelElement() { .idShort(SUBMODEL_TECHNICAL_DATA_RANGE_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_RANGE_CATEGORY) .min(SUBMODEL_TECHNICAL_DATA_RANGE_MIN_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .max(SUBMODEL_TECHNICAL_DATA_RANGE_MAX_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); } public static MultiLanguageProperty createMultiLanguagePropertySubmodelElement() { - return new DefaultMultiLanguageProperty.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultMultiLanguageProperty.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_MULTI_LANG) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -221,7 +221,7 @@ public static MultiLanguageProperty createMultiLanguagePropertySubmodelElement() } public static File createFileSubmodelElement() { - return new DefaultFile.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultFile.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_FILE) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -234,7 +234,7 @@ public static File createFileSubmodelElement() { } public static Blob createBlobSubmodelElement() { - return new DefaultBlob.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultBlob.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_BLOB) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -247,7 +247,7 @@ public static Blob createBlobSubmodelElement() { } public static Entity createEntitySubmodelElement() { - return new DefaultEntity.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultEntity.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_ENTITY) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -256,13 +256,13 @@ public static Entity createEntitySubmodelElement() { .category(SUBMODEL_TECHNICAL_DATA_ENTITY_CATEGORY) .statements(Arrays.asList(createPropertySubmodelElement(), createRangeSubmodelElement())) .entityType(EntityType.CO_MANAGED_ENTITY) - .globalAssetID(GLOBAL_ASSET_ID) + .globalAssetId(GLOBAL_ASSET_ID) .specificAssetIds(ENTITY_SPECIFIC_ASSET_ID) .build(); } public static ReferenceElement createReferenceElementSubmodelElement() { - return new DefaultReferenceElement.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultReferenceElement.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_REFERENCE_ELEMENT) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -274,7 +274,7 @@ public static ReferenceElement createReferenceElementSubmodelElement() { } public static RelationshipElement createRelationshipElementSubmodelElement() { - return new DefaultRelationshipElement.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultRelationshipElement.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_RELATIONSHIP_ELEMENT) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -287,7 +287,7 @@ public static RelationshipElement createRelationshipElementSubmodelElement() { } public static AnnotatedRelationshipElement createAnnotatedRelationshipElementSubmodelElement() { - return new DefaultAnnotatedRelationshipElement.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultAnnotatedRelationshipElement.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_ANNOTATED_RELATIONSHIP_ELEMENT) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -301,7 +301,7 @@ public static AnnotatedRelationshipElement createAnnotatedRelationshipElementSub } public static SubmodelElementCollection createSubmodelElementCollection() { - return new DefaultSubmodelElementCollection.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultSubmodelElementCollection.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_SUBMODEL_ELEMENT_COLLECTION) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -313,7 +313,7 @@ public static SubmodelElementCollection createSubmodelElementCollection() { } public static SubmodelElementList createSubmodelElementList() { - return new DefaultSubmodelElementList.Builder().semanticID(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) + return new DefaultSubmodelElementList.Builder().semanticId(new DefaultReference.Builder().keys(new DefaultKey.Builder().type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_SUBMODEL_ELEMENT_LIST) .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -352,7 +352,7 @@ private static OperationVariable[] square(OperationVariable[] inputs) { } private static DefaultOperationVariable createIntOperationVariable(String idShort) { - return new DefaultOperationVariable.Builder().value(new DefaultProperty.Builder().idShort(idShort).valueType(DataTypeDefXSD.INT).build()).build(); + return new DefaultOperationVariable.Builder().value(new DefaultProperty.Builder().idShort(idShort).valueType(DataTypeDefXsd.INT).build()).build(); } private static DefaultReference createFirstReference() { diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceSuite.java b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceSuite.java index 8679ed099..407833647 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceSuite.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/SubmodelServiceSuite.java @@ -33,7 +33,7 @@ import java.util.Arrays; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; @@ -130,7 +130,7 @@ public void getHierarchicalSubmodelElementWhenFirstElementIsList() { Property testProperty = new DefaultProperty.Builder().idShort("propIdShort") .category("cat1") .value("123") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); listElements.add(testProperty); submodelElementList.setValue(listElements); @@ -322,13 +322,13 @@ public void createNestedSubmodelElement() { Property propertyInSmeCol = new DefaultProperty.Builder().idShort("test123") .category("cat1") .value("305") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); Property propertyInSmeList = new DefaultProperty.Builder().idShort("test456") .category("cat1") .value("305") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); String idShortPathPropertyInSmeCol = DummySubmodelFactory.SUBMODEL_OPERATIONAL_DATA_ELEMENT_COLLECTION_ID_SHORT; @@ -474,7 +474,7 @@ private DefaultProperty createDummyProperty(String idShort) { return new DefaultProperty.Builder().idShort(idShort) .category("cat1") .value("123") - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); } diff --git a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/value/TestMappedSubmodelElementValue.java b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/value/TestMappedSubmodelElementValue.java index 6b8539be8..5c8ca2262 100644 --- a/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/value/TestMappedSubmodelElementValue.java +++ b/basyx.submodelservice/basyx.submodelservice-core/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/value/TestMappedSubmodelElementValue.java @@ -33,7 +33,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Blob; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -53,7 +53,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.basyx.submodelservice.SubmodelServiceHelper; import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.AnnotatedRelationshipElementValueMapper; import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.BlobValueMapper; @@ -83,13 +83,13 @@ public class TestMappedSubmodelElementValue { private ReferenceValue referenceValue_first = new ReferenceValue(ReferenceTypes.EXTERNAL_REFERENCE, Arrays.asList(new DefaultKey.Builder().type(KeyTypes.CAPABILITY) .value("CapabilityType") .build())); - private String globalAssetID = "globalAssetID"; + private String globalAssetId = "globalAssetID"; private ReferenceValue referenceValue_second = new ReferenceValue(ReferenceTypes.MODEL_REFERENCE, Arrays.asList(new DefaultKey.Builder().type(KeyTypes.RELATIONSHIP_ELEMENT) .value("RelationshipElement") .build())); - private List specificAssetIDValues = Arrays.asList(new SpecificAssetIDValue(new DefaultSpecificAssetID.Builder().value("value") + private List specificAssetIdValues = Arrays.asList(new SpecificAssetIdValue(new DefaultSpecificAssetId.Builder().value("value") .name("name") - .externalSubjectID(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .externalSubjectId(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder().value("keyValue") .type(KeyTypes.GLOBAL_REFERENCE) .build()) @@ -132,7 +132,7 @@ public void mappedGetPropertyValue() { String expectedValue = "200"; Property property = new DefaultProperty.Builder().value(expectedValue) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build(); ValueMapper rangeValueMapper = new PropertyValueMapper(property); @@ -254,11 +254,11 @@ public void mappedGetEntityValue() { public void mappedSetEntityValue() { Entity entity = SubmodelServiceHelper.createEntitySubmodelElement(); - EntityValue entityValue = new EntityValue(valueOnlies, testEntityType, globalAssetID, specificAssetIDValues); + EntityValue entityValue = new EntityValue(valueOnlies, testEntityType, globalAssetId, specificAssetIdValues); setReferenceElementValue(entity, entityValue); - assertValuesAreEqual(valueOnlies, testEntityType, globalAssetID, specificAssetIDValues, entity); + assertValuesAreEqual(valueOnlies, testEntityType, globalAssetId, specificAssetIdValues, entity); } @Test @@ -404,7 +404,7 @@ private static void assertValuesAreEqual(List expectedValueOnlies, Re .getType()); } - private static void assertValuesAreEqual(List expectedValueOnlies, EntityType expectedEntityType, String expectedGlobalAssetID, List expectedSpecificAssetIdValues, Entity entity) { + private static void assertValuesAreEqual(List expectedValueOnlies, EntityType expectedEntityType, String expectedGlobalAssetId, List expectedSpecificAssetIdValues, Entity entity) { assertEquals(((PropertyValue) expectedValueOnlies.get(0) .getSubmodelElementValue()).getValue(), ((Property) entity.getStatements() @@ -422,10 +422,10 @@ private static void assertValuesAreEqual(List expectedValueOnlies, En assertEquals(expectedEntityType, entity.getEntityType()); - assertEquals(expectedGlobalAssetID, entity.getGlobalAssetID()); + assertEquals(expectedGlobalAssetId, entity.getGlobalAssetId()); assertEquals(expectedSpecificAssetIdValues.stream() - .map(SpecificAssetIDValue::toSpecificAssetID) + .map(SpecificAssetIdValue::toSpecificAssetId) .collect(Collectors.toList()), entity.getSpecificAssetIds()); } @@ -654,7 +654,7 @@ private void setMultiLanguagePropertyValue(List valueToWrite } private SubmodelElement getSubmodelElementAtIndex(SubmodelElementCollection submodelElementCollection, int index) { - return ((List) submodelElementCollection.getValue()).get(index); + return submodelElementCollection.getValue().get(index); } private SubmodelElement getSubmodelElementAtIndex(SubmodelElementList submodelElementList, int index) { diff --git a/basyx.submodelservice/basyx.submodelservice-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/http/SubmodelServiceHTTPSerializationExtension.java b/basyx.submodelservice/basyx.submodelservice-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/http/SubmodelServiceHTTPSerializationExtension.java index a9fafca77..9d9c5ad81 100644 --- a/basyx.submodelservice/basyx.submodelservice-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/http/SubmodelServiceHTTPSerializationExtension.java +++ b/basyx.submodelservice/basyx.submodelservice-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/http/SubmodelServiceHTTPSerializationExtension.java @@ -26,13 +26,13 @@ package org.eclipse.digitaltwin.basyx.submodelservice.http; import org.eclipse.digitaltwin.basyx.deserialization.SubmodelElementValueJsonDeserializer; -import org.eclipse.digitaltwin.basyx.deserialization.SpecificAssetIDValueJsonDeserializer; +import org.eclipse.digitaltwin.basyx.deserialization.SpecificAssetIdValueJsonDeserializer; import org.eclipse.digitaltwin.basyx.deserialization.ValueOnlyJsonDeserializer; import org.eclipse.digitaltwin.basyx.http.SerializationExtension; import org.eclipse.digitaltwin.basyx.mixins.ReferenceElementValueMixIn; import org.eclipse.digitaltwin.basyx.serialization.MultiLanguagePropertyValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.PropertyValueSerializer; -import org.eclipse.digitaltwin.basyx.serialization.SpecificAssetIDValueSerializer; +import org.eclipse.digitaltwin.basyx.serialization.SpecificAssetIdValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelElementCollectionValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelElementListValueSerializer; import org.eclipse.digitaltwin.basyx.serialization.SubmodelValueOnlySerializer; @@ -40,7 +40,7 @@ import org.eclipse.digitaltwin.basyx.submodelservice.value.MultiLanguagePropertyValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.PropertyValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.ReferenceElementValue; -import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIDValue; +import org.eclipse.digitaltwin.basyx.submodelservice.value.SpecificAssetIdValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementCollectionValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementListValue; import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementValue; @@ -70,8 +70,8 @@ public void extend(Jackson2ObjectMapperBuilder builder) { builder.serializerByType(SubmodelElementListValue.class, new SubmodelElementListValueSerializer()); builder.mixIn(ReferenceElementValue.class, ReferenceElementValueMixIn.class); builder.serializerByType(SubmodelValueOnly.class, new SubmodelValueOnlySerializer()); - builder.deserializerByType(SpecificAssetIDValue.class, new SpecificAssetIDValueJsonDeserializer()); - builder.serializerByType(SpecificAssetIDValue.class, new SpecificAssetIDValueSerializer()); + builder.deserializerByType(SpecificAssetIdValue.class, new SpecificAssetIdValueJsonDeserializer()); + builder.serializerByType(SpecificAssetIdValue.class, new SpecificAssetIdValueSerializer()); } } diff --git a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/Submodel.json b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/Submodel.json index 8777cfa13..c83974bcb 100644 --- a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/Submodel.json +++ b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/Submodel.json @@ -1,6 +1,7 @@ { "modelType": "Submodel", "id": "8A7104BDAB57E185", + "kind": "Instance", "idShort": "AllSubmodelElementsIdShort", "submodelElements": [ { @@ -323,7 +324,7 @@ "modelType": "SubmodelElementList", "category": "PARAMETER", "idShort": "SubmodelElementList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Range", @@ -423,7 +424,7 @@ { "modelType": "SubmodelElementList", "idShort": "SimpleList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Property", diff --git a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElements.json b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElements.json index 4a76041f0..1efab173e 100644 --- a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElements.json +++ b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElements.json @@ -301,7 +301,7 @@ { "modelType": "SubmodelElementList", "idShort": "SimpleList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Property", @@ -364,7 +364,7 @@ "modelType": "SubmodelElementList", "category": "PARAMETER", "idShort": "SubmodelElementList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Range", diff --git a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElementsPaginated.json b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElementsPaginated.json index 88c35a6ee..c3b3a5dd2 100644 --- a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElementsPaginated.json +++ b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelElementsPaginated.json @@ -5,7 +5,7 @@ { "modelType": "SubmodelElementList", "idShort": "SimpleList", - "orderRelevant": false, + "orderRelevant": true, "value": [ { "modelType": "Property", diff --git a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelMetadata.json b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelMetadata.json index b65ec9451..a85d97b76 100644 --- a/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelMetadata.json +++ b/basyx.submodelservice/basyx.submodelservice-http/src/test/resources/SubmodelMetadata.json @@ -1,5 +1,6 @@ { "modelType": "Submodel", "id": "8A7104BDAB57E185", + "kind": "Instance", "idShort": "AllSubmodelElementsIdShort" } \ No newline at end of file diff --git a/basyx.submodelservice/basyx.submodelservice.component/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/component/SubmodelServiceConfiguration.java b/basyx.submodelservice/basyx.submodelservice.component/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/component/SubmodelServiceConfiguration.java index c6d9d0858..0e9c2c44a 100644 --- a/basyx.submodelservice/basyx.submodelservice.component/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/component/SubmodelServiceConfiguration.java +++ b/basyx.submodelservice/basyx.submodelservice.component/src/main/java/org/eclipse/digitaltwin/basyx/submodelservice/component/SubmodelServiceConfiguration.java @@ -95,7 +95,7 @@ public static Submodel getSubmodel() { .id("TestID") .idShort("test") .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder().keys(refKeys) + .semanticId(new DefaultReference.Builder().keys(refKeys) .build()) .submodelElements(smeList) .build(); diff --git a/basyx.submodelservice/basyx.submodelservice.component/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/component/TestSubmodelServiceHTTP.java b/basyx.submodelservice/basyx.submodelservice.component/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/component/TestSubmodelServiceHTTP.java index a5091adb3..296fbfc8e 100644 --- a/basyx.submodelservice/basyx.submodelservice.component/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/component/TestSubmodelServiceHTTP.java +++ b/basyx.submodelservice/basyx.submodelservice.component/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/component/TestSubmodelServiceHTTP.java @@ -25,8 +25,6 @@ package org.eclipse.digitaltwin.basyx.submodelservice.component; -import static org.junit.jupiter.api.Assertions.assertEquals; - import java.io.IOException; import org.apache.hc.client5.http.impl.classic.BasicHttpClientResponseHandler; @@ -55,7 +53,7 @@ public void rightSubmodelIsReturnedOnGetRequest() throws IOException { CloseableHttpResponse response = BaSyxHttpTestUtils.executeGetOnURL(accessUrl); String actualSubmodel = new BasicHttpClientResponseHandler().handleResponse(response); String expectedSubmodel = BaSyxHttpTestUtils.readJSONStringFromClasspath(SUBMODEL_PATH); - assertEquals(expectedSubmodel, actualSubmodel); + BaSyxHttpTestUtils.assertSameJSONContent(expectedSubmodel, actualSubmodel); } @AfterAll diff --git a/basyx.submodelservice/basyx.submodelservice.component/src/test/resources/TechnicalSubmodel.json b/basyx.submodelservice/basyx.submodelservice.component/src/test/resources/TechnicalSubmodel.json index 49bc152f7..f06a7c0aa 100644 --- a/basyx.submodelservice/basyx.submodelservice.component/src/test/resources/TechnicalSubmodel.json +++ b/basyx.submodelservice/basyx.submodelservice.component/src/test/resources/TechnicalSubmodel.json @@ -1 +1,35 @@ -{"modelType":"Submodel","kind":"Instance","id":"TestID","category":"TestCategory","idShort":"test","submodelElements":[{"modelType":"Property","value":"test","idShort":"test"}],"semanticId":{"keys":[{"type":null,"value":"123"}],"type":null},"description":[{"language":"de-DE","text":"Test"}],"displayName":[{"language":"de-DE","text":"Test"}]} \ No newline at end of file +{ + "modelType": "Submodel", + "kind": "Instance", + "id": "TestID", + "category": "TestCategory", + "submodelElements": [ + { + "modelType": "Property", + "value": "test", + "idShort": "test" + } + ], + "semanticId": { + "keys": [ + { + "type": null, + "value": "123" + } + ], + "type": null + }, + "description": [ + { + "language": "de-DE", + "text": "Test" + } + ], + "displayName": [ + { + "language": "de-DE", + "text": "Test" + } + ], + "idShort": "test" +} diff --git a/pom.xml b/pom.xml index ef8775129..8d725b726 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ ${revision} 8081 8081 - 1.0.0-milestone-03.1 + 1.0.0-milestone-04