LocaleWS { @RequestMapping(value = "/api/locales", method = RequestMethod.GET) public List<Locale> getLocales(@RequestParam(value = "bcp47Tag", required = false) String bcp47Tag) { return localeRepository.findAll( where(ifParamNotNull(bcp47TagEquals(bcp47Tag))) ); }  @RequestMapping(value = "/api/locales", method = RequestMethod.GET) List<Locale> getLocales(@RequestParam(value = "bcp47Tag", required = false) String bcp47Tag);  }
@Test public void testGetLocales() { List<Locale> locales = localeClient.getLocales(); List<com.box.l10n.mojito.entity.Locale> expectedLocales = localeRepository.findAll(); assertEquals(expectedLocales.size(), locales.size()); List<String> expectedBcp47Tags = new ArrayList<>(); for (com.box.l10n.mojito.entity.Locale expectedLocale : expectedLocales) { expectedBcp47Tags.add(expectedLocale.getBcp47Tag()); } for (Locale locale : locales) { assertTrue(expectedBcp47Tags.contains(locale.getBcp47Tag())); } }