@Test public void testGetPromptForRootButNotConnected() { ReflectionTestUtils.setField(ambariContext, "cluster", null); String result = ambariContext.getPrompt(); assertEquals("ambari-shell>", result); }
public String getPrompt() { return focus.isType(FocusType.ROOT) ? isConnectedToCluster() ? formatPrompt(focus.getPrefix(), cluster) : "ambari-shell>" : formatPrompt(focus.getPrefix(), focus.getValue()); }
AmbariContext { public String getPrompt() { return focus.isType(FocusType.ROOT) ? isConnectedToCluster() ? formatPrompt(focus.getPrefix(), cluster) : "ambari-shell>" : formatPrompt(focus.getPrefix(), focus.getValue()); } }
AmbariContext { public String getPrompt() { return focus.isType(FocusType.ROOT) ? isConnectedToCluster() ? formatPrompt(focus.getPrefix(), cluster) : "ambari-shell>" : formatPrompt(focus.getPrefix(), focus.getValue()); } AmbariContext(); }
AmbariContext { public String getPrompt() { return focus.isType(FocusType.ROOT) ? isConnectedToCluster() ? formatPrompt(focus.getPrefix(), cluster) : "ambari-shell>" : formatPrompt(focus.getPrefix(), focus.getValue()); } AmbariContext(); void setCluster(String cluster); void resetFocus(); void setFocus(String id, FocusType type); String getFocusValue(); boolean areBlueprintsAvailable(); void setHint(Hints hint); String getPrompt(); boolean isConnectedToCluster(); boolean isFocusOnHost(); boolean isFocusOnClusterBuild(); String getHint(); String getCluster(); void setBlueprintsAvailable(boolean blueprintsAvailable); }
AmbariContext { public String getPrompt() { return focus.isType(FocusType.ROOT) ? isConnectedToCluster() ? formatPrompt(focus.getPrefix(), cluster) : "ambari-shell>" : formatPrompt(focus.getPrefix(), focus.getValue()); } AmbariContext(); void setCluster(String cluster); void resetFocus(); void setFocus(String id, FocusType type); String getFocusValue(); boolean areBlueprintsAvailable(); void setHint(Hints hint); String getPrompt(); boolean isConnectedToCluster(); boolean isFocusOnHost(); boolean isFocusOnClusterBuild(); String getHint(); String getCluster(); void setBlueprintsAvailable(boolean blueprintsAvailable);  }