Search in sources :

Example 1 with TableMasterClient

use of alluxio.client.table.TableMasterClient in project alluxio by Alluxio.

the class TransformTableCommandTest method transformInternal.

private void transformInternal(String definition, String expected) throws Exception {
    TableMasterClient client = mock(TableMasterClient.class);
    when(client.transformTable(ArgumentMatchers.anyString(), ArgumentMatchers.anyString(), ArgumentMatchers.anyString())).thenReturn(0L);
    TransformTableCommand command = new TransformTableCommand(new InstancedConfiguration(ConfigurationUtils.defaults()), client, null);
    ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
    if (definition != null) {
        command.run(command.parseAndValidateArgs("db", "table", definition));
    } else {
        command.run(command.parseAndValidateArgs("db", "table"));
    }
    verify(client).transformTable(ArgumentMatchers.anyString(), ArgumentMatchers.anyString(), argumentCaptor.capture());
    assertEquals(expected, argumentCaptor.getValue());
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) TableMasterClient(alluxio.client.table.TableMasterClient) TransformTableCommand(alluxio.cli.table.command.TransformTableCommand)

Aggregations

TransformTableCommand (alluxio.cli.table.command.TransformTableCommand)1 TableMasterClient (alluxio.client.table.TableMasterClient)1 InstancedConfiguration (alluxio.conf.InstancedConfiguration)1