use of com.google.api.ads.admanager.axis.v202202.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.v202202.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.v202202.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.v202202.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testBindVariables_bool.
@Test
public void testBindVariables_bool() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.where("bool = :bool").withBindVariableValue("bool", true).toStatement();
String_ValueMapEntry entry = statement.getValues(0);
assertEquals("bool", entry.getKey());
assertEquals(BooleanValue.class, entry.getValue().getClass());
assertEquals(true, ((BooleanValue) entry.getValue()).getValue());
}
use of com.google.api.ads.admanager.axis.v202202.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testRemoveLimitAndOffset.
@Test
public void testRemoveLimitAndOffset() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement initialOffset = statementBuilder.where("id = 1").limit(100).offset(100).toStatement();
assertEquals("WHERE id = 1 LIMIT 100 OFFSET 100", initialOffset.getQuery());
Statement removed = statementBuilder.removeLimitAndOffset().toStatement();
assertEquals("WHERE id = 1", removed.getQuery());
}
Aggregations