Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.eclipse.digitaltwin.basyx.pagination.GetSubmodelElementsResult;
import org.eclipse.digitaltwin.basyx.submodelrepository.SubmodelRepository;
import org.eclipse.digitaltwin.basyx.submodelrepository.http.pagination.GetSubmodelsResult;
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementListValue;
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelElementValue;
import org.eclipse.digitaltwin.basyx.submodelservice.value.SubmodelValueOnly;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -277,6 +278,9 @@ public ResponseEntity<Void> patchSubmodelByIdValueOnly(Base64UrlEncodedIdentifie
}

private ResponseEntity<Void> handleSubmodelElementValueSetRequest(Base64UrlEncodedIdentifier submodelIdentifier, String idShortPath, SubmodelElementValue body) {
if(body instanceof SubmodelElementListValue){
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED);
}
repository.setSubmodelElementValue(submodelIdentifier.getIdentifier(), idShortPath, body);
return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.RelationshipElementValueMapper;
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.SubmodelElementCollectionValueMapper;
import org.eclipse.digitaltwin.basyx.submodelservice.value.mapper.SubmodelElementListValueMapper;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.*;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

Expand Down Expand Up @@ -388,6 +385,7 @@ public void getSubmodelElementListValue() {
assertEquals(1, submodelElementList.getValue().getSubmodelElementValues().size());
}

@Ignore("Patch Endpoint for SubmodelElementList Values is disabled as it is not working.")
@Test
public void setSubmodelElementListValue() {
DefaultSubmodelElementList submodelElementList = getDefaultSubmodelElementList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.eclipse.digitaltwin.basyx.http.serialization.BaSyxHttpTestUtils;
import org.eclipse.digitaltwin.basyx.submodelservice.DummySubmodelFactory;
import org.eclipse.digitaltwin.basyx.submodelservice.SubmodelServiceHelper;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -360,6 +361,7 @@ public void getSubmodelElementListValue() throws IOException, ParseException {
BaSyxHttpTestUtils.assertSameJSONContent(expectedValue, BaSyxHttpTestUtils.getResponseAsString(response));
}

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