Skip to content

Commit 681e7e5

Browse files
authored
Revert document store createOrReplace api (#257)
* Revert document store createOrReplace api * fix dependency check * resolve comment
1 parent ff9afcf commit 681e7e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config-service-impl/src/main/java/org/hypertrace/config/service/store/DocumentConfigStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public UpsertedConfig writeConfig(
102102
.asRuntimeException();
103103
}
104104
} else {
105-
collection.createOrReplace(latestDocKey, latestConfigDocument);
105+
collection.upsert(latestDocKey, latestConfigDocument);
106106
}
107107

108108
return optionalPreviousConfig

config-service-impl/src/test/java/org/hypertrace/config/service/store/DocumentConfigStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void WriteConfigForCreate() throws IOException {
8989

9090
ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
9191
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
92-
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
92+
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());
9393

9494
Key key = keyCaptor.getValue();
9595
Document document = documentCaptor.getValue();
@@ -129,7 +129,7 @@ void WriteConfigForUpdateWithoutUpsertCondition() throws IOException {
129129

130130
ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
131131
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
132-
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
132+
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());
133133

134134
Key key = keyCaptor.getValue();
135135
Document document = documentCaptor.getValue();

0 commit comments

Comments
 (0)