use of org.apache.rya.shell.util.InstallPrompt in project incubator-rya by apache.
the class RyaAdminCommandsTest method installWithAccumuloParameters_userAbort.
@Test
public void installWithAccumuloParameters_userAbort() throws DuplicateInstanceNameException, RyaClientException, IOException {
// Mock the object that performs the install operation.
final Install mockInstall = mock(Install.class);
final RyaClient mockCommands = mock(RyaClient.class);
when(mockCommands.getInstall()).thenReturn(mockInstall);
final SharedShellState state = new SharedShellState();
state.connectedToAccumulo(mock(AccumuloConnectionDetails.class), mockCommands);
final String instanceName = "unitTests";
final boolean enableTableHashPrefix = false;
final boolean enableEntityCentricIndex = true;
final boolean enableFreeTextIndex = false;
final boolean enableTemporalIndex = false;
final boolean enablePcjIndex = true;
final String fluoPcjAppName = instanceName + "pcj_updater";
// Execute the command.
final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(enableTableHashPrefix).setEnableEntityCentricIndex(enableEntityCentricIndex).setEnableFreeTextIndex(enableFreeTextIndex).setEnableTemporalIndex(enableTemporalIndex).setEnablePcjIndex(enablePcjIndex).setFluoPcjAppName(fluoPcjAppName).build();
final InstallPrompt mockInstallPrompt = mock(InstallPrompt.class);
when(mockInstallPrompt.promptInstanceName()).thenReturn(instanceName);
when(mockInstallPrompt.promptInstallConfiguration(instanceName)).thenReturn(installConfig);
when(mockInstallPrompt.promptVerified(eq(instanceName), eq(installConfig))).thenReturn(false);
final RyaAdminCommands commands = new RyaAdminCommands(state, mockInstallPrompt, mock(SparqlPrompt.class), mock(UninstallPrompt.class));
final String message = commands.installWithAccumuloParameters(instanceName, enableTableHashPrefix, enableEntityCentricIndex, enableFreeTextIndex, enableTemporalIndex, enablePcjIndex, fluoPcjAppName);
// Verify a message is returned that indicates the success of the operation.
final String expected = "Skipping Installation.";
assertEquals(expected, message);
}
Aggregations