use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testIncreaseOffset.
@Test
public void testIncreaseOffset() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement initialOffset = statementBuilder.limit(100).offset(100).toStatement();
assertEquals("LIMIT 100 OFFSET 100", initialOffset.getQuery());
Statement increasedOffset = statementBuilder.increaseOffsetBy(100).toStatement();
assertEquals("LIMIT 100 OFFSET 200", increasedOffset.getQuery());
}
use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testFrom.
@Test
public void testFrom() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.from("line_item").toStatement();
assertEquals("FROM line_item", statement.getQuery());
}
use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testIncreaseOffset.
@Test
public void testIncreaseOffset() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement initialOffset = statementBuilder.limit(100).offset(100).toStatement();
assertEquals("LIMIT 100 OFFSET 100", initialOffset.getQuery());
Statement increasedOffset = statementBuilder.increaseOffsetBy(100).toStatement();
assertEquals("LIMIT 100 OFFSET 200", increasedOffset.getQuery());
}
use of com.google.api.ads.admanager.jaxws.v202205.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());
}
use of com.google.api.ads.admanager.jaxws.v202205.Statement in project googleads-java-lib by googleads.
the class StatementBuilderTest method testBindVariables_text.
@Test
public void testBindVariables_text() {
StatementBuilder statementBuilder = new StatementBuilder();
Statement statement = statementBuilder.where("text = :text").withBindVariableValue("text", "foo").toStatement();
String_ValueMapEntry entry = statement.getValues(0);
assertEquals("text", entry.getKey());
assertEquals(TextValue.class, entry.getValue().getClass());
assertEquals("foo", ((TextValue) entry.getValue()).getValue());
}
Aggregations