use of jakarta.nosql.query.InsertQuery in project jnosql-diana by eclipse.
the class InsertQueryProviderTest method shouldReturnParserQuery9.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "insert God (name = \"Diana\") 10 minute" })
public void shouldReturnParserQuery9(String query) {
InsertQuery insertQuery = checkInsertFromStart(query);
checkTTL(insertQuery, Duration.ofMinutes(10L));
}
use of jakarta.nosql.query.InsertQuery in project jnosql-diana by eclipse.
the class InsertQueryProviderTest method shouldReturnParserQuery14.
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "insert Person {\"name\":\"Ada Lovelace\"}" })
public void shouldReturnParserQuery14(String query) {
InsertQuery insertQuery = insertQueryProvider.apply(query);
assertEquals("Person", insertQuery.getEntity());
Assertions.assertTrue(insertQuery.getConditions().isEmpty());
Assertions.assertTrue(insertQuery.getValue().isPresent());
JSONQueryValue JSONQueryValue = insertQuery.getValue().get();
JsonObject jsonObject = JSONQueryValue.get();
assertEquals("Ada Lovelace", jsonObject.getString("name"));
}
Aggregations