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