PdxRealizer extends ReadOnlyConfigurationRealizer<Pdx, PdxInfo> { @Override public PdxInfo get(Pdx config, InternalCache cache) { PdxInfo info = new PdxInfo(); info.setReadSerialized(cache.getPdxReadSerialized()); if (cache.getPdxPersistent()) { info.setDiskStoreName(cache.getPdxDiskStore()); } info.setIgnoreUnreadFields(cache.getPdxIgnoreUnreadFields()); PdxSerializer pdxSerializer = cache.getPdxSerializer(); if (pdxSerializer != null) { info.setPdxSerializer(pdxSerializer.getClass().getName()); } return info; }  @Override PdxInfo get(Pdx config, InternalCache cache);  }
@Test public void getPdxInformation() { when(cache.getPdxReadSerialized()).thenReturn(true); PdxInfo pdxInfo = pdxRealizer.get(null, cache); assertThat(pdxInfo.isReadSerialized()).isTrue(); assertThat(pdxInfo.isIgnoreUnreadFields()).isFalse(); }
@Test public void persistent() throws Exception { when(cache.getPdxPersistent()).thenReturn(false); when(cache.getPdxDiskStore()).thenReturn("test"); PdxInfo pdxInfo = pdxRealizer.get(null, cache); assertThat(pdxInfo.getDiskStoreName()).isNull(); when(cache.getPdxPersistent()).thenReturn(true); pdxInfo = pdxRealizer.get(null, cache); assertThat(pdxInfo.getDiskStoreName()).isEqualTo("test"); }