Skip to content

Commit

Permalink
remove unreachable code due to expected exception being thrown
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuel Alves <[email protected]>
  • Loading branch information
ejba committed Sep 14, 2023
1 parent bbd3b20 commit 2d3d7da
Showing 1 changed file with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,6 @@ public void saveUpdateAndGetStateWithWrongEtag() {

Mono<Void> finalSaveResponse = saveResponse;
assertThrows(RuntimeException.class, finalSaveResponse::block);

response = daprClient.getState(STATE_STORE_NAME, new State<>(stateKey, (MyData) null, null), MyData.class);
//retrive the data wihout any etag
myDataResponse = response.block();

//review that state value changes
assertNotNull(myDataResponse.getEtag());
//review that the etag changes after an update
assertNotEquals(firstETag, myDataResponse.getEtag());
assertNotNull(myDataResponse.getKey());
assertNotNull(myDataResponse.getValue());
assertEquals("data in property A2", myDataResponse.getValue().getPropertyA());
assertEquals("data in property B2", myDataResponse.getValue().getPropertyB());
}

@Test
Expand Down Expand Up @@ -515,15 +502,7 @@ public void saveAndDeleteStateWithWrongEtag() {
//Create deferred action to delete an state sending the incorrect etag
Mono<Void> deleteResponse = daprClient.deleteState(STATE_STORE_NAME, stateKey, "99999999999", null);
//execute the delete of the state, this should throw an exception

assertThrows(RuntimeException.class, deleteResponse::block);

//Create deferred action to get the state without an etag
response = daprClient.getState(STATE_STORE_NAME, new State<>(stateKey), MyData.class);
myDataResponse = response.block();

//Review that the response is null, because the state was deleted
assertNull(myDataResponse.getValue());
}

@Test
Expand Down

0 comments on commit 2d3d7da

Please sign in to comment.