@Test
  public void returnNullAppDictionaryWithoutDiscovery() throws Exception {
    DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider(false);
    provider.addApplicationDictionary(new ApplVerID(FIX44), null, dictionaryForTest1);

    DataDictionary dd = provider.getApplicationDataDictionary(new ApplVerID(FIX40), null);

    assertThat(dd, is(nullValue()));
  }
  @Test
  public void throwExceptionIfAppVersionIsNotFound() throws Exception {
    DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider();

    try {
      provider.getApplicationDataDictionary(new ApplVerID("999"), null);
    } catch (QFJException e) {
      assertThat(e.getMessage(), containsString(" 999"));
    }
  }
  @Test
  public void throwExceptionIfAppDictionaryIsNotFound() throws Exception {
    DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider();

    try {
      provider.getApplicationDataDictionary(new ApplVerID(FIX44), "Invalid_Test");
    } catch (QFJException e) {
      assertThat(e.getCause(), is(ConfigError.class));
    }
  }
  @Test
  public void returnAppDictionaryWithDiscovery() throws Exception {
    DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider();
    provider.addApplicationDictionary(new ApplVerID(FIX44), null, dictionaryForTest1);

    DataDictionary dd = provider.getApplicationDataDictionary(new ApplVerID(FIX40), null);

    assertThat(dd, is(notNullValue()));
    assertThat(dd.getVersion(), is(FixVersions.BEGINSTRING_FIX40));
  }
  @Test
  public void returnCustomAppDictionaryWithoutDiscovery() throws Exception {
    DefaultDataDictionaryProvider provider = new DefaultDataDictionaryProvider(false);
    provider.addApplicationDictionary(new ApplVerID(FIX44), null, dictionaryForTest1);
    provider.addApplicationDictionary(new ApplVerID(FIX40), CUSTOM_APP_VERSION, dictionaryForTest2);

    DataDictionary dd =
        provider.getApplicationDataDictionary(new ApplVerID(FIX40), CUSTOM_APP_VERSION);

    assertThat(dd, is(dictionaryForTest2));
  }