Skip to content

Commit

Permalink
Revert document store createOrReplace api (#257)
Browse files Browse the repository at this point in the history
* Revert document store createOrReplace api

* fix dependency check

* resolve comment
  • Loading branch information
bhubam authored Nov 26, 2024
1 parent ff9afcf commit 681e7e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public UpsertedConfig writeConfig(
.asRuntimeException();
}
} else {
collection.createOrReplace(latestDocKey, latestConfigDocument);
collection.upsert(latestDocKey, latestConfigDocument);
}

return optionalPreviousConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void WriteConfigForCreate() throws IOException {

ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());

Key key = keyCaptor.getValue();
Document document = documentCaptor.getValue();
Expand Down Expand Up @@ -129,7 +129,7 @@ void WriteConfigForUpdateWithoutUpsertCondition() throws IOException {

ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());

Key key = keyCaptor.getValue();
Document document = documentCaptor.getValue();
Expand Down

0 comments on commit 681e7e5

Please sign in to comment.