Skip to content

Commit 109b1dc

Browse files
fixed
1 parent 1bf1bce commit 109b1dc

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void testVector() {
6161
});
6262

6363
final UUID collectionId = collections.getResources().get(0).getId();
64-
final Documents documents = api.getDocumentsByCollectionId("reosurceGroup", collectionId);
64+
final Documents documents = api.getAllDocuments("reosurceGroup", collectionId);
6565
assertThat(documents).isNotNull();
6666
final DocumentKeyValueListPair documentMeta =
6767
DocumentKeyValueListPair.create()
@@ -80,7 +80,7 @@ void testVector() {
8080

8181
final UUID documentId = documents.getResources().get(0).getId();
8282
final DocumentResponse document =
83-
api.getDocumentByIdForCollection("reosurceGroup", collectionId, documentId);
83+
api.getDocumentById("reosurceGroup", collectionId, documentId);
8484
assertThat(document).isNotNull();
8585
assertThat(document.getId()).isEqualTo(documentId);
8686
assertThat(document.getMetadata()).isNotNull().containsExactly(documentMeta);

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.sap.ai.sdk.grounding.model.CollectionsListResponse;
88
import com.sap.ai.sdk.grounding.model.DataRepositories;
9-
import com.sap.ai.sdk.grounding.model.DataRepositorySearchResults;
109
import com.sap.ai.sdk.grounding.model.DocumentResponse;
1110
import com.sap.ai.sdk.grounding.model.Documents;
1211
import com.sap.ai.sdk.grounding.model.DocumentsListResponse;
@@ -90,7 +89,7 @@ void testCreateDeleteCollection() {
9089
Object search = controller.searchInDocuments(JSON_FORMAT);
9190
assertThat(search).isInstanceOf(SearchResults.class);
9291
final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH);
93-
this.assertDocumentSearchResult((DataRepositorySearchResults) search, dayOfWeek);
92+
this.assertDocumentSearchResult((SearchResults) search, dayOfWeek);
9493

9594
// (5) CLEAN UP
9695
Object deletion = controller.deleteCollection(collectionUuid, JSON_FORMAT);
@@ -102,14 +101,14 @@ void testCreateDeleteCollection() {
102101
.hasMessageContaining("404 Not Found");
103102
}
104103

105-
private void assertDocumentSearchResult(DataRepositorySearchResults search, String dayOfWeek) {
104+
private void assertDocumentSearchResult(SearchResults search, String dayOfWeek) {
106105
assertThat(search.getResults()).isNotEmpty();
107106
for (final var resultsByFilter : search.getResults()) {
108107
assertThat(resultsByFilter.getFilterId()).isEqualTo("question");
109108
assertThat(resultsByFilter.getResults()).isNotEmpty();
110109
for (final var result : resultsByFilter.getResults()) {
111-
assertThat(result.getDataRepository().getDocuments()).isNotEmpty();
112-
for (final var document : result.getDataRepository().getDocuments()) {
110+
assertThat(result.getDocuments()).isNotEmpty();
111+
for (final var document : result.getDocuments()) {
113112
assertThat(document.getChunks()).isNotEmpty();
114113
for (final var chunk : document.getChunks()) {
115114
assertThat(chunk.getContent()).contains(dayOfWeek);

0 commit comments

Comments
 (0)