DefaultDataDictionaryProvider implements DataDictionaryProvider { public DataDictionary getApplicationDataDictionary(ApplVerID applVerID) { AppVersionKey appVersionKey = new AppVersionKey(applVerID); DataDictionary dd = applicationDictionaries.get(appVersionKey); if (dd == null && findDataDictionaries) { String beginString = toBeginString(applVerID); String path = beginString.replace(".", "") + ".xml"; try { dd = new DataDictionary(path); applicationDictionaries.put(appVersionKey, dd); } catch (ConfigError e) { throw new QFJException(e); } } return dd; } DefaultDataDictionaryProvider();  DefaultDataDictionaryProvider(boolean findDataDictionaries); synchronized DataDictionary getSessionDataDictionary(String beginString); DataDictionary getApplicationDataDictionary(ApplVerID applVerID); void addTransportDictionary(String beginString, DataDictionary dd); void addApplicationDictionary(ApplVerID applVerID, DataDictionary dataDictionary);  }
@Test public void throwExceptionIfAppDictionaryIsNotFound() throws Exception { DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider(); try { provider.getApplicationDataDictionary(new ApplVerID("Invalid_Test")); } catch (QFJException e) { assertThat(e.getMessage(), containsString("Unknown or unsupported ApplVerID")); } }
@Test public void throwExceptionIfAppVersionIsNotFound() throws Exception { DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider(); try { provider.getApplicationDataDictionary(new ApplVerID("999")); } catch (QFJException e) { assertThat(e.getMessage(), containsString(" 999")); } }