Skip to content

Commit

Permalink
implements comments on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoimariew authored Jun 5, 2024
1 parent d7f9b3d commit 29a2858
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,15 @@ public void updateNonFileSME() throws FileNotFoundException, IOException, ParseE
}

@Test
public void updateNonNestedSME() throws FileNotFoundException, IOException, ParseException {

public void updateNonNestedSME() throws FileNotFoundException, IOException, ParseException {
String submodelJSON = getJSONValueAsString("SingleSubmodelNew.json");

String element = getJSONValueAsString("PropertySubmodelElementUpdate.json");

String idShortPathPropertyInRootSme = "MaxRotationSpeed";

CloseableHttpResponse creationResponse = BaSyxSubmodelHttpTestUtils.createSubmodel(getURL(), submodelJSON);
assertSubmodelCreationReponse(submodelJSON, creationResponse);

String element = getJSONValueAsString("PropertySubmodelElementUpdate.json");
String idShortPathPropertyInRootSme = "MaxRotationSpeed";

CloseableHttpResponse updatedResponse = updateElement(createSpecificSubmodelElementURL(DummySubmodelFactory.SUBMODEL_TECHNICAL_DATA_ID,idShortPathPropertyInRootSme), element);
assertEquals(HttpStatus.NO_CONTENT.value(), updatedResponse.getCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,19 @@ public void updateNonFileSME() {
public void updateNonNestedSME() {
Submodel technicalSubmodel = DummySubmodelFactory.createTechnicalDataSubmodel();
SubmodelService submodelService = getSubmodelService(technicalSubmodel);

Property property = createDummyProperty("test123");

submodelService.createSubmodelElement(property);

String idShortPathRootSME = "test123";

Property newProperty = SubmodelServiceHelper.createDummyProperty("test123", "arbitraryValue", DataTypeDefXsd.STRING);
Property expectedUpdatedProperty = SubmodelServiceHelper.createDummyProperty("test123", "arbitraryValue", DataTypeDefXsd.STRING);

submodelService.updateSubmodelElement(idShortPathRootSME, newProperty);

Property updatedProperty = (Property) submodelService.getSubmodelElement(idShortPathRootSME);
Property actualUpdatedProperty = (Property) submodelService.getSubmodelElement(idShortPathRootSME);

assertEquals(newProperty, updatedProperty);
}

Expand Down

0 comments on commit 29a2858

Please sign in to comment.