### Question:
StepIdentifier { @JsonIgnore public URI getStepUriForRedirect() { return createUriForRedirect(RedirectType.STEP, null); } StepIdentifier();  StepIdentifier(final BuildIdentifier buildIdentifier, final String usecaseName, final String scenarioName,
			final String pageName, final int pageOccurrence, final int stepInPageOccurrence);  StepIdentifier(final BuildIdentifier buildIdentifier, final String usecaseName, final String scenarioName,
			final String pageName, final int pageOccurrence, final int stepInPageOccurrence, final Set<String> labels);  StepIdentifier(final ScenarioIdentifier scenarioIdentifier, final String pageName, final int pageOccurrence,
			final int stepInPageOccurrence);  StepIdentifier(final ScenarioIdentifier scenarioIdentifier, final String pageName, final int pageOccurrence,
			final int stepInPageOccurrence, final Set<String> labels); static StepIdentifier withDifferentStepInPageOccurrence(final StepIdentifier stepIdentifier,
			final int stepInPageOccurrence); static StepIdentifier withDifferentIds(final StepIdentifier stepIdentifier, final int pageOccurrence,
			final int stepInPageOccurrence); static StepIdentifier forFallBackScenario(final StepIdentifier originalStepIdentifier,
			final String fallbackUsecaseName, final String fallbackScenarioName, final int pageOccurrence,
			final int stepInPageOccurrence); StepIdentifier withDifferentBuildIdentifier(final BuildIdentifier buildIdentifierBeforeAliasResolution); @JsonIgnore BuildIdentifier getBuildIdentifier(); @JsonIgnore ScenarioIdentifier getScenarioIdentifier(); @JsonIgnore void setScenarioIdentifier(final ScenarioIdentifier scenarioIdentifier); @XmlElement String getBranchName(); void setBranchName(final String branchName); @XmlElement String getBuildName(); void setBuildName(final String buildName); @XmlElement String getUsecaseName(); void setUsecaseName(final String usecaseName); @XmlElement String getScenarioName(); void setScenarioName(final String scenarioName); String getPageName(); void setPageName(final String pageName); int getPageOccurrence(); void setPageOccurrence(final int pageOccurrence); int getStepInPageOccurrence(); void setStepInPageOccurrence(final int stepInPageOccurrence); Set<String> getLabels(); void setLabels(final Set<String> labels); @JsonIgnore URI getScreenshotUriForRedirect(final String screenshotFileNameExtension); @JsonIgnore URI getStepUriForRedirect(); @Override String toString();  }### Answer:
@Test public void redirectUrlForStepWithoutContextPath() { String contextPath = ContextPathHolder.INSTANCE.getContextPath(); ContextPathHolder.INSTANCE.setContextPath(""); try { assertEquals( "/rest/branch/bugfix-branch/build/build-2014-08-12/usecase/Find the answer/scenario/Actually find it/pageName/pageName1/pageOccurrence/0/stepInPageOccurrence/0", stepIdentifier.getStepUriForRedirect().getPath()); assertEquals("fallback=true", stepIdentifier.getStepUriForRedirect().getQuery()); } finally { ContextPathHolder.INSTANCE.setContextPath(contextPath); } }
@Test public void redirectUrlForStep() { assertEquals( "/scenarioo/rest/branch/bugfix-branch/build/build-2014-08-12/usecase/Find the answer/scenario/Actually find it/pageName/pageName1/pageOccurrence/0/stepInPageOccurrence/0", stepIdentifier.getStepUriForRedirect().getPath()); assertEquals("fallback=true", stepIdentifier.getStepUriForRedirect().getQuery()); }