use of alluxio.cli.table.command.TransformTableCommand 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());
}
Aggregations