Application extends AuthenticatedWebApplication implements IApplication { @Override public String getOmString(String key, long languageId) { return getString(key, languageId); }  static OmAuthenticationStrategy getAuthenticationStrategy(); @Override Class<? extends Page> getHomePage(); @Override Class<? extends WebPage> getSignInPageClass(); static Application get(); static DashboardContext getDashboardContext(); static void kickUser(Client client); static boolean isInvaldSession(String sessionId); static void removeInvalidSession(String sessionId); @Override T getBean(Class<T> clazz); static String getString(String id); static Locale getLocale(final long languageId); static String getString(String key, final long languageId); static String getString(String key, final Locale loc, String... inParams); static boolean isInstalled(); static String getContactsLink(); @Override String getOmContactsLink(); @Override String getOmInvitationLink(Invitation i, String baseUrl); @Override String urlForActivatePage(PageParameters pp); static String getInvitationLink(Invitation i, String baseUrl); boolean isRoomAllowedToUser(Room r, User u); static boolean isUrlValid(String url); static String urlForPage(Class<? extends Page> clazz, PageParameters pp, String inBaseUrl); @Override String getOmString(String key, long languageId); @Override String getOmString(String key); @Override String getOmString(String key, final Locale loc, String... params); @Override String getServerId(); @Override void updateJpaAddresses(); @Override void publishWsTopic(IClusterWsMessage msg); @Override String getWsUrl(); static final String NAME_ATTR_KEY; static final String SERVER_URL_ATTR_KEY; static final String HASH_MAPPING; static final String SIGNIN_MAPPING; static final String NOTINIT_MAPPING; }
@Test void testMissing() { assertEquals("[Missing]", app.getOmString("909", Locale.ENGLISH)); }
@Test void testLblWithApp() { final String newAppName = "AAAAA"; final String prevAppName = getApplicationName(); try { setApplicationName(newAppName); List<Locale> locales = LabelDao.getLanguages().stream().map(Entry::getValue).collect(Collectors.toList()); for (Locale l : locales) { for (String key : Application.STRINGS_WITH_APP) { final String str = app.getOmString(key, l); assertNotNull(str, "Label with key '" + key + "' for locale " + l + " should exist"); assertTrue(str.contains(newAppName), "Label with key '" + key + "' for locale " + l + " is invalid: " + str); } } } finally { setApplicationName(prevAppName); } }