### Question:
MessageBundleController { @ResponseBody @RequestMapping(value = {"/rave_client_messages.js"}, method = RequestMethod.GET) public ResponseEntity<String> getClientMessages(HttpServletRequest request) { return new ResponseEntity<String>(getClientMessagesJSForLocale(acceptHeaderLocaleResolver.resolveLocale(request)), clientMessagesResponseHeaders, HttpStatus.OK); } MessageBundleController(); @ResponseBody @RequestMapping(value = {"/rave_client_messages.js"}, method = RequestMethod.GET) ResponseEntity<String> getClientMessages(HttpServletRequest request);  }### Answer:
@Test public void getClientMessages_defaultLocale() { final String EXPECTED_JS = buildExpectedJavaScript("mother", "father", "text with \\\"quotes\\\""); assertResponseEntity(messageBundleController.getClientMessages(request), EXPECTED_JS, HttpStatus.OK); }
@Test public void getClientMessages_nlLocale() { Locale nlLocale = new Locale("nl","NL"); request.addPreferredLocale(nlLocale); final String EXPECTED_JS = buildExpectedJavaScript("moeder", "vader", "tekst met \\\"quotes\\\""); assertResponseEntity(messageBundleController.getClientMessages(request), EXPECTED_JS, HttpStatus.OK); }
@Test public void getClientMessages_cachedRequest() { Locale nlLocale = new Locale("nl","NL"); request.addPreferredLocale(nlLocale); final String EXPECTED_UNCACHED_JS = buildExpectedJavaScript("moeder", "vader", "tekst met \\\"quotes\\\""); final String EXPECTED_CACHED_JS = buildExpectedJavaScript("moeder", "vader", "tekst met \\\"quotes\\\""); assertResponseEntity(messageBundleController.getClientMessages(request), EXPECTED_UNCACHED_JS, HttpStatus.OK); assertResponseEntity(messageBundleController.getClientMessages(request), EXPECTED_CACHED_JS, HttpStatus.OK); }