Search in sources :

Example 21 with Statement

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

the class StatementBuilderTest method testWhere_stripsWhere.

@Test
public void testWhere_stripsWhere() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.where("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)

Example 22 with Statement

use of com.google.api.ads.admanager.jaxws.v202108.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());
}
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 23 with Statement

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

the class StatementBuilderTest method testSelect.

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

Example 24 with Statement

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

the class StatementBuilderTest method testOrderBy.

@Test
public void testOrderBy() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.orderBy("id ASC").toStatement();
    assertEquals("ORDER BY id ASC", statement.getQuery());
}
Also used : Statement(com.google.api.ads.admanager.axis.v202202.Statement) Test(org.junit.Test)

Example 25 with Statement

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

the class StatementBuilderTest method testSelect_stripsSelect.

@Test
public void testSelect_stripsSelect() {
    StatementBuilder statementBuilder = new StatementBuilder();
    Statement statement = statementBuilder.select("SELECT id, name").toStatement();
    assertEquals("SELECT id, name", 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