import org.sonar.server.exceptions.Errors;
import org.sonar.server.exceptions.Message;
import org.sonar.server.plugins.MimeTypes;
+import org.sonar.server.user.MockUserSession;
+import org.sonar.server.user.UserSession;
import javax.annotation.Nullable;
@Test
public void bad_request_with_i18n_message() throws Exception {
+ MockUserSession.set().setLocale(Locale.ENGLISH);
ValidatingRequest request = new SimpleRequest("GET").setParam("count", "3");
ServletResponse response = new ServletResponse();
when(i18n.message(Locale.ENGLISH, "bad.request.reason", "bad.request.reason", 0)).thenReturn("reason #0");
@Test
public void bad_request_with_multiple_i18n_messages() throws Exception {
+ MockUserSession.set().setLocale(Locale.ENGLISH);
+
ValidatingRequest request = new SimpleRequest("GET").setParam("count", "3");
ServletResponse response = new ServletResponse();
when(i18n.message(Locale.ENGLISH, "bad.request.reason", "bad.request.reason", 0)).thenReturn("reason #0");