15
15
import org .typesense .api .exceptions .ObjectNotFound ;
16
16
import org .typesense .model .CollectionSchema ;
17
17
import org .typesense .model .DeleteDocumentsParameters ;
18
+ import org .typesense .model .DirtyValues ;
18
19
import org .typesense .model .ExportDocumentsParameters ;
19
20
import org .typesense .model .Field ;
20
21
import org .typesense .model .ImportDocumentsParameters ;
22
+ import org .typesense .model .IndexAction ;
21
23
import org .typesense .model .SearchParameters ;
22
24
import org .typesense .model .SearchResult ;
23
25
import org .typesense .model .UpdateDocumentsParameters ;
24
- import org .typesense .model .ImportDocumentsParameters .ActionEnum ;
25
26
26
27
class DocumentsTest {
27
28
@@ -183,7 +184,7 @@ void testImport() throws Exception {
183
184
184
185
documentList .add (document1 );
185
186
documentList .add (document2 );
186
- queryParameters .action (ImportDocumentsParameters . ActionEnum .CREATE );
187
+ queryParameters .action (IndexAction .CREATE );
187
188
188
189
String countriesImport = this .client .collections ("books" ).documents ()
189
190
.import_ (documentList , queryParameters );
@@ -193,7 +194,7 @@ void testImport() throws Exception {
193
194
@ Test
194
195
void testImportAsString () throws Exception {
195
196
ImportDocumentsParameters queryParameters = new ImportDocumentsParameters ();
196
- queryParameters .action (ImportDocumentsParameters . ActionEnum .CREATE );
197
+ queryParameters .action (IndexAction .CREATE );
197
198
String documentList = "{\" countryName\" : \" India\" , \" capital\" : \" Washington\" , \" gdp\" : 5215}\n " +
198
199
"{\" countryName\" : \" Iran\" , \" capital\" : \" London\" , \" gdp\" : 5215}" ;
199
200
String booksImport = this .client .collections ("books" ).documents ().import_ (documentList ,
@@ -216,8 +217,8 @@ void testDirtyCreate() throws Exception {
216
217
helper .createTestDocument ();
217
218
218
219
ImportDocumentsParameters queryParameters = new ImportDocumentsParameters ();
219
- queryParameters .dirtyValues (ImportDocumentsParameters . DirtyValuesEnum .COERCE_OR_REJECT );
220
- queryParameters .action (ImportDocumentsParameters . ActionEnum .UPSERT );
220
+ queryParameters .dirtyValues (DirtyValues .COERCE_OR_REJECT );
221
+ queryParameters .action (IndexAction .UPSERT );
221
222
222
223
String [] authors = { "shakspeare" , "william" };
223
224
HashMap <String , Object > hmap = new HashMap <>();
@@ -247,7 +248,7 @@ void testNestedObjectImport() throws Exception {
247
248
client .collections ().create (collectionSchema );
248
249
249
250
ImportDocumentsParameters queryParameters = new ImportDocumentsParameters ();
250
- queryParameters .action (ImportDocumentsParameters . ActionEnum .CREATE );
251
+ queryParameters .action (IndexAction .CREATE );
251
252
252
253
List <NestedDocument > docs = new ArrayList <>();
253
254
NestedDocument doc = new NestedDocument ("LA" , "CA" , "USA" )
0 commit comments