Search in sources :

Example 16 with NumberQueryValue

use of jakarta.nosql.query.NumberQueryValue in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery3.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del -12" })
public void shouldReturnParserQuery3(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(-12L, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 17 with NumberQueryValue

use of jakarta.nosql.query.NumberQueryValue in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery4.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del -12.12" })
public void shouldReturnParserQuery4(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(-12.12, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 18 with NumberQueryValue

use of jakarta.nosql.query.NumberQueryValue in project jnosql-diana by eclipse.

the class GetProviderTest method shouldReturnParserQuery2.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "get 12.12" })
public void shouldReturnParserQuery2(String query) {
    GetQuery getQuery = queryProvider.apply(query);
    List<QueryValue<?>> keys = getQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(12.12, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) GetQuery(jakarta.nosql.query.GetQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 19 with NumberQueryValue

use of jakarta.nosql.query.NumberQueryValue in project jnosql-diana by eclipse.

the class GetProviderTest method shouldReturnParserQuery1.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "get 12" })
public void shouldReturnParserQuery1(String query) {
    GetQuery getQuery = queryProvider.apply(query);
    List<QueryValue<?>> keys = getQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(12L, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) GetQuery(jakarta.nosql.query.GetQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 20 with NumberQueryValue

use of jakarta.nosql.query.NumberQueryValue in project jnosql-diana by eclipse.

the class GetProviderTest method shouldReturnParserQuery3.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "get -12" })
public void shouldReturnParserQuery3(String query) {
    GetQuery getQuery = queryProvider.apply(query);
    List<QueryValue<?>> keys = getQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(-12L, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) GetQuery(jakarta.nosql.query.GetQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

NumberQueryValue (jakarta.nosql.query.NumberQueryValue)36 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)36 ValueSource (org.junit.jupiter.params.provider.ValueSource)36 Condition (jakarta.nosql.query.Condition)26 StringQueryValue (jakarta.nosql.query.StringQueryValue)21 Where (jakarta.nosql.query.Where)20 ConditionQueryValue (jakarta.nosql.query.ConditionQueryValue)10 DeleteQuery (jakarta.nosql.query.DeleteQuery)10 JSONQueryValue (jakarta.nosql.query.JSONQueryValue)10 SelectQuery (jakarta.nosql.query.SelectQuery)10 JsonObject (javax.json.JsonObject)10 ArrayQueryValue (jakarta.nosql.query.ArrayQueryValue)8 QueryValue (jakarta.nosql.query.QueryValue)8 DelQuery (jakarta.nosql.query.DelQuery)4 Function (jakarta.nosql.query.Function)4 FunctionQueryValue (jakarta.nosql.query.FunctionQueryValue)4 GetQuery (jakarta.nosql.query.GetQuery)4 InsertQuery (jakarta.nosql.query.InsertQuery)3 UpdateQuery (jakarta.nosql.query.UpdateQuery)3 PutQuery (jakarta.nosql.query.PutQuery)2