EmrOpenmrsUrlOverrideController { @RequestMapping("/forgotPassword.form") public String showOurForgotPasswordPage() { return Context.isAuthenticated() ? ("redirect:/" + OPENMRS_HOME_URL) : ("forward:/" + KENYAEMR_FORGOTPASSWORD_URL); }  @RequestMapping("/index.htm") String showOurHomePage(); @RequestMapping("/login.htm") String showOurLoginPage(); @RequestMapping("/forgotPassword.form") String showOurForgotPasswordPage();  }
@Test public void showOurForgotPasswordPage() { PowerMockito.when(Context.isAuthenticated()).thenReturn(false); Assert.assertThat(controller.showOurForgotPasswordPage(), is("forward:/kenyaemr/forgotPassword.page")); PowerMockito.when(Context.isAuthenticated()).thenReturn(true); Assert.assertThat(controller.showOurForgotPasswordPage(), is("redirect:/index.htm")); }