Skip to content

Commit 58084c1

Browse files
authored
Disables PatchSubmodelElementByPathValueOnly Endpoint for SubmodelElementListValue (#915)
* Disables PatchSubmodelElementByPathValueOnly Endpoint for SubmodelElementList * Disables Tests for PatchSubmodelElementByPathValueOnly Endpoint for SubmodelElementList
1 parent 776c499 commit 58084c1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

basyx.submodelrepository/basyx.submodelrepository-http/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/http/SubmodelRepositoryApiHTTPController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.eclipse.digitaltwin.basyx.pagination.GetSubmodelElementsResult;
5656
import org.eclipse.digitaltwin.basyx.submodelrepository.SubmodelRepository;
5757
import org.eclipse.digitaltwin.basyx.submodelrepository.http.pagination.GetSubmodelsResult;
58+
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementListValue;
5859
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementValue;
5960
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelValueOnly;
6061
import org.springframework.beans.factory.annotation.Autowired;
@@ -277,6 +278,9 @@ public ResponseEntity<Void> patchSubmodelByIdValueOnly(Base64UrlEncodedIdentifie
277278
}
278279

279280
private ResponseEntity<Void> handleSubmodelElementValueSetRequest(Base64UrlEncodedIdentifier submodelIdentifier, String idShortPath, SubmodelElementValue body) {
281+
if(body instanceof SubmodelElementListValue){
282+
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED);
283+
}
280284
repository.setSubmodelElementValue(submodelIdentifier.getIdentifier(), idShortPath, body);
281285
return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
282286
}

basyx.submodelservice/basyx.submodelservice-client/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/client/TestConnectedSubmodelElements.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@
9090
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.RelationshipElementValueMapper;
9191
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.SubmodelElementCollectionValueMapper;
9292
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.SubmodelElementListValueMapper;
93-
import org.junit.After;
94-
import org.junit.AfterClass;
95-
import org.junit.BeforeClass;
96-
import org.junit.Test;
93+
import org.junit.*;
9794
import org.springframework.boot.builder.SpringApplicationBuilder;
9895
import org.springframework.context.ConfigurableApplicationContext;
9996

@@ -388,6 +385,7 @@ public void getSubmodelElementListValue() {
388385
assertEquals(1, submodelElementList.getValue().getSubmodelElementValues().size());
389386
}
390387

388+
@Ignore("Patch Endpoint for SubmodelElementList Values is disabled as it is not working.")
391389
@Test
392390
public void setSubmodelElementListValue() {
393391
DefaultSubmodelElementList submodelElementList = getDefaultSubmodelElementList();

basyx.submodelservice/basyx.submodelservice-http/src/test/java/org/eclipse/digitaltwin/basyx/submodelservice/http/SubmodelServiceSubmodelElementsTestSuiteHTTP.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.eclipse.digitaltwin.basyx.http.serialization.BaSyxHttpTestUtils;
5050
import org.eclipse.digitaltwin.basyx.submodelservice.DummySubmodelFactory;
5151
import org.eclipse.digitaltwin.basyx.submodelservice.SubmodelServiceHelper;
52+
import org.junit.Ignore;
5253
import org.junit.Test;
5354
import org.springframework.core.io.ClassPathResource;
5455
import org.springframework.http.HttpStatus;
@@ -360,6 +361,7 @@ public void getSubmodelElementListValue() throws IOException, ParseException {
360361
BaSyxHttpTestUtils.assertSameJSONContent(expectedValue, BaSyxHttpTestUtils.getResponseAsString(response));
361362
}
362363

364+
@Ignore("Patch Endpoint for SubmodelElementList Values is disabled as it is not working.")
363365
@Test
364366
public void setSubmodelElementListValue() throws IOException, ParseException {
365367
String expectedValue = getJSONValueAsString("value/setSubmodelElementListValue.json");

0 commit comments

Comments
 (0)