Search in sources :

Example 1 with VariablesList

use of io.confluent.ksql.rest.entity.VariablesList in project ksql by confluentinc.

the class ListVariablesExecutorTest method shouldListVariables.

@Test
public void shouldListVariables() {
    // Given:
    sessionProperties.setVariable("var1", "1");
    sessionProperties.setVariable("var2", "2");
    // When:
    final KsqlEntity response = executeListVariables("LIST VARIABLES;").get();
    // Then:
    final VariablesList variablesList = (VariablesList) response;
    assertThat(variablesList.getStatementText(), is("LIST VARIABLES;"));
    assertThat(variablesList.getVariables().get(0), is(new VariablesList.Variable("var1", "1")));
    assertThat(variablesList.getVariables().get(1), is(new VariablesList.Variable("var2", "2")));
}
Also used : VariablesList(io.confluent.ksql.rest.entity.VariablesList) KsqlEntity(io.confluent.ksql.rest.entity.KsqlEntity) Test(org.junit.Test)

Aggregations

KsqlEntity (io.confluent.ksql.rest.entity.KsqlEntity)1 VariablesList (io.confluent.ksql.rest.entity.VariablesList)1 Test (org.junit.Test)1