@Test(expected = CliArgsException.class) public void testUnrecognizedOption() throws Exception { String[] parameters = {"-v", "-k"}; Configuration configuration = getConfiguration(); CliFrontend testFrontend = new CliFrontend( configuration, Collections.singletonList(getCli(configuration))); testFrontend.list(parameters); }
@Test public void testList() throws Exception { // test list properly { String[] parameters = {"-r", "-s", "-a"}; ClusterClient<String> clusterClient = createClusterClient(); MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient); testFrontend.list(parameters); Mockito.verify(clusterClient, times(1)) .listJobs(); } }