Search in sources :

Example 16 with Statement

use of com.google.api.ads.admanager.jaxws.v202202.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());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202111.Statement) Test(org.junit.Test)

Example 17 with Statement

use of com.google.api.ads.admanager.jaxws.v202202.Statement in project googleads-java-lib by googleads.

the class StatementBuilderTest method testLimit.

@Test
public void testLimit() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.limit(500).toStatement();
    assertEquals("LIMIT 500", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202202.Statement) Test(org.junit.Test)

Example 18 with Statement

use of com.google.api.ads.admanager.jaxws.v202202.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());
}
Also used : String_ValueMapEntry(com.google.api.ads.admanager.axis.v202202.String_ValueMapEntry) Statement(com.google.api.ads.admanager.axis.v202202.Statement) Test(org.junit.Test)

Example 19 with Statement

use of com.google.api.ads.admanager.jaxws.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());
}
Also used : String_ValueMapEntry(com.google.api.ads.admanager.axis.v202202.String_ValueMapEntry) Statement(com.google.api.ads.admanager.axis.v202202.Statement) Test(org.junit.Test)

Example 20 with Statement

use of com.google.api.ads.admanager.jaxws.v202202.Statement in project googleads-java-lib by googleads.

the class StatementBuilderTest method testWhere.

@Test
public void testWhere() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.where("id = 12345").toStatement();
    assertEquals("WHERE id = 12345", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202202.Statement) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)61 Statement (com.google.api.ads.admanager.axis.v202105.Statement)16 Statement (com.google.api.ads.admanager.axis.v202108.Statement)16 Statement (com.google.api.ads.admanager.axis.v202111.Statement)16 Statement (com.google.api.ads.admanager.axis.v202202.Statement)16 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202105.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202108.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202111.String_ValueMapEntry)4 String_ValueMapEntry (com.google.api.ads.admanager.axis.v202202.String_ValueMapEntry)4 Session (org.neo4j.driver.v1.Session)2 Statement (org.neo4j.driver.v1.Statement)2 StatementResult (org.neo4j.driver.v1.StatementResult)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Statement (com.google.api.ads.admanager.jaxws.v202105.Statement)1 StringValueMapEntry (com.google.api.ads.admanager.jaxws.v202105.StringValueMapEntry)1 Statement (com.google.api.ads.admanager.jaxws.v202108.Statement)1 StringValueMapEntry (com.google.api.ads.admanager.jaxws.v202108.StringValueMapEntry)1 Statement (com.google.api.ads.admanager.jaxws.v202111.Statement)1 StringValueMapEntry (com.google.api.ads.admanager.jaxws.v202111.StringValueMapEntry)1 Statement (com.google.api.ads.admanager.jaxws.v202202.Statement)1