use of org.springframework.shell.core.CommandResult in project tutorials by eugenp.
the class SimpleCLIIntegrationTest method givenCommandConfig_whenExecutingWebGetCommand_thenCorrectResult.
@Test
public void givenCommandConfig_whenExecutingWebGetCommand_thenCorrectResult() {
final CommandResult resultWebSave = shell.executeCommand("web-get --url https://www.google.com");
Assert.assertTrue(resultWebSave.isSuccess());
}
use of org.springframework.shell.core.CommandResult in project tutorials by eugenp.
the class SimpleCLIIntegrationTest method givenCommandConfig_whenAdminEnableCommandExecuted_thenCorrectAvailability.
@Test
public void givenCommandConfig_whenAdminEnableCommandExecuted_thenCorrectAvailability() {
final CommandResult resultAdminDisable = shell.executeCommand("admin-disable");
final CommandResult resultWebSaveUnavailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
final CommandResult resultAdminEnable = shell.executeCommand("admin-enable");
final CommandResult resultWebSaveAvailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
Assert.assertArrayEquals(new boolean[] { resultAdminDisable.isSuccess(), resultWebSaveUnavailable.isSuccess(), resultAdminEnable.isSuccess(), resultWebSaveAvailable.isSuccess() }, new boolean[] { true, false, true, true });
}
Aggregations