Skip to content

Commit bb01310

Browse files
authored
Fixes wrong status code for PUT AssetInformation (#865)
* Fixes wrong status code for PUT AssetInformation * Fixes failing tests
1 parent eab96b0 commit bb01310

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

basyx.aasrepository/basyx.aasrepository-feature-authorization/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/authorization/TestAuthorizedAasRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public void setAssetInformationWithCorrectRoleAndPermission() throws IOException
474474
String accessToken = getAccessToken(DummyCredentialStore.BASYX_ASSET_UPDATER_CREDENTIAL);
475475

476476
CloseableHttpResponse retrievalResponse = updateElementWithAuthorizationPutRequest(getSpecificAssetInformationAccessURL(SPECIFIC_SHELL_ID_2), getAasJSONString("assetInfoSimple.json"), accessToken);
477-
assertEquals(HttpStatus.OK.value(), retrievalResponse.getCode());
477+
assertEquals(HttpStatus.NO_CONTENT.value(), retrievalResponse.getCode());
478478

479479
deleteElementWithAuthorization(getSpecificAasAccessURL(SPECIFIC_SHELL_ID_2), getAccessToken(DummyCredentialStore.ADMIN_CREDENTIAL));
480480
}
@@ -486,7 +486,7 @@ public void setAssetInformationWithCorrectRoleAndSpecificAasPermission() throws
486486
String accessToken = getAccessToken(DummyCredentialStore.BASYX_ASSET_UPDATER_TWO_CREDENTIAL);
487487

488488
CloseableHttpResponse retrievalResponse = updateElementWithAuthorizationPutRequest(getSpecificAssetInformationAccessURL(SPECIFIC_SHELL_ID_2), getAasJSONString("assetInfoSimple.json"), accessToken);
489-
assertEquals(HttpStatus.OK.value(), retrievalResponse.getCode());
489+
assertEquals(HttpStatus.NO_CONTENT.value(), retrievalResponse.getCode());
490490

491491
deleteElementWithAuthorization(getSpecificAasAccessURL(SPECIFIC_SHELL_ID_2), getAccessToken(DummyCredentialStore.ADMIN_CREDENTIAL));
492492
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public ResponseEntity<AssetInformation> getAssetInformationAasRepository(Base64U
180180
@Override
181181
public ResponseEntity<Void> putAssetInformationAasRepository(Base64UrlEncodedIdentifier aasIdentifier, @Valid AssetInformation body) {
182182
aasRepository.setAssetInformation(aasIdentifier.getIdentifier(), body);
183-
return new ResponseEntity<Void>(HttpStatus.OK);
183+
return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
184184
}
185185

186186
private String getEncodedCursorFromCursorResult(CursorResult<?> cursorResult) {

0 commit comments

Comments
 (0)