use of com.google.api.ads.admanager.axis.v202105.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testLimitOffsetDefaults.
@Test
public void testLimitOffsetDefaults() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement initialOffset = statementBuilder.limit(100).toStatement();
assertEquals("LIMIT 100", initialOffset.getQuery());
Statement increasedOffset = statementBuilder.increaseOffsetBy(100).toStatement();
assertEquals("LIMIT 100 OFFSET 100", increasedOffset.getQuery());
}
use of com.google.api.ads.admanager.axis.v202105.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testBindVariables_number.
@Test
public void testBindVariables_number() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.where("number = :number").withBindVariableValue("number", 1).toStatement();
String_ValueMapEntry entry = statement.getValues(0);
assertEquals("number", entry.getKey());
assertEquals(NumberValue.class, entry.getValue().getClass());
assertEquals("1", ((NumberValue) entry.getValue()).getValue());
}
use of com.google.api.ads.admanager.axis.v202105.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testFrom_stripsFrom.
@Test
public void testFrom_stripsFrom() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.from("FROM line_item").toStatement();
assertEquals("FROM line_item", statement.getQuery());
}
use of com.google.api.ads.admanager.axis.v202105.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testOrderBy_stripsOrderBy.
@Test
public void testOrderBy_stripsOrderBy() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.orderBy("ORDER BY id ASC").toStatement();
assertEquals("ORDER BY id ASC", statement.getQuery());
}
use of com.google.api.ads.admanager.axis.v202105.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testLimitOffsetDefaults.
@Test
public void testLimitOffsetDefaults() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement initialOffset = statementBuilder.limit(100).toStatement();
assertEquals("LIMIT 100", initialOffset.getQuery());
Statement increasedOffset = statementBuilder.increaseOffsetBy(100).toStatement();
assertEquals("LIMIT 100 OFFSET 100", increasedOffset.getQuery());
}
Aggregations