OcelotContext { public Locale getLocale() { Locale locale = getLocaleFromHttpSession(); if(locale == null) { locale = Locale.US; } return locale; }  HttpSession getHttpSession(); Locale getLocale(); void setLocale(Locale locale); boolean isUserInRole(String role); Principal getPrincipal();  }
@Test public void testGetLocale() { System.out.println("getLocale"); doReturn(null).doReturn(Locale.FRANCE).when(instance).getLocaleFromHttpSession(); Locale result = instance.getLocale(); assertThat(result).isEqualTo(Locale.US); result = instance.getLocale(); assertThat(result).isEqualTo(Locale.FRANCE); }