ThesaurusManager implements ThesaurusFinder { @Override @Nullable public Thesaurus getThesaurusByName(@Nonnull String thesaurusName) { return getThesauriMap().get(thesaurusName); }  synchronized void init(boolean isTest, ServiceContext context, String thesauriRepository); Path buildThesaurusFilePath(String fname, String type, String dname); void addThesaurus(Thesaurus gst, boolean writeTitle); void remove(String name); Path getThesauriDirectory(); @Override Map<String, Thesaurus> getThesauriMap(); @Override @Nullable Thesaurus getThesaurusByName(@Nonnull String thesaurusName); @Override Thesaurus getThesaurusByConceptScheme(String uri); @Override boolean existsThesaurus(String name); String createUpdateThesaurusFromRegister(String uuid, String type, ServiceContext context); Element buildResultfromThTable(ServiceContext context);  }
@Test public void testGetThesaurusByName() throws Exception { this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, false); assertNull(this.thesaurusManager.getThesaurusByName(AllThesaurus.ALL_THESAURUS_KEY)); this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, true); assertNotNull(this.thesaurusManager.getThesaurusByName(AllThesaurus.ALL_THESAURUS_KEY)); this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, false); assertNull(this.thesaurusManager.getThesaurusByName(AllThesaurus.ALL_THESAURUS_KEY)); }