@Test public void testDestroy() { tested.setDomain("someDomain"); tested.destroy(); verify(cache, times(1)).clear(); assertNull(tested.getCache()); }
@PreDestroy public void destroy() { if (null != cache) { cache.clear(); cache = null; } }
CommonDomainLookups { @PreDestroy public void destroy() { if (null != cache) { cache.clear(); cache = null; } } }
CommonDomainLookups { @PreDestroy public void destroy() { if (null != cache) { cache.clear(); cache = null; } } @Inject  CommonDomainLookups(final DefinitionUtils definitionUtils,
                               final DefinitionsCacheRegistry definitionsRegistry,
                               final RuleManager ruleManager);   CommonDomainLookups(final DefinitionUtils definitionUtils,
                        final DefinitionsCacheRegistry definitionsRegistry,
                        final RuleManager ruleManager,
                        final Function<String, DomainLookupsCache> cacheBuilder); }
CommonDomainLookups { @PreDestroy public void destroy() { if (null != cache) { cache.clear(); cache = null; } } @Inject  CommonDomainLookups(final DefinitionUtils definitionUtils,
                               final DefinitionsCacheRegistry definitionsRegistry,
                               final RuleManager ruleManager);   CommonDomainLookups(final DefinitionUtils definitionUtils,
                        final DefinitionsCacheRegistry definitionsRegistry,
                        final RuleManager ruleManager,
                        final Function<String, DomainLookupsCache> cacheBuilder); CommonDomainLookups setDomain(final String defSetId); Set<String> lookupTargetConnectors(final Node<? extends Definition<Object>, ? extends Edge> sourceNode); Set<String> lookupTargetNodes(final Graph<?, ? extends Node> graph,
                                         final Node<? extends Definition<Object>, ? extends Edge> sourceNode,
                                         final String edgeId); Set<String> lookupTargetNodes(final Graph<?, ? extends Node> graph,
                                         final Node<? extends Definition<Object>, ? extends Edge> sourceNode,
                                         final String edgeId,
                                         final Predicate<String> definitionIdsAllowedFilter); Set<String> lookupMorphBaseDefinitions(final Set<String> definitionIds); @PreDestroy void destroy(); }
CommonDomainLookups { @PreDestroy public void destroy() { if (null != cache) { cache.clear(); cache = null; } } @Inject  CommonDomainLookups(final DefinitionUtils definitionUtils,
                               final DefinitionsCacheRegistry definitionsRegistry,
                               final RuleManager ruleManager);   CommonDomainLookups(final DefinitionUtils definitionUtils,
                        final DefinitionsCacheRegistry definitionsRegistry,
                        final RuleManager ruleManager,
                        final Function<String, DomainLookupsCache> cacheBuilder); CommonDomainLookups setDomain(final String defSetId); Set<String> lookupTargetConnectors(final Node<? extends Definition<Object>, ? extends Edge> sourceNode); Set<String> lookupTargetNodes(final Graph<?, ? extends Node> graph,
                                         final Node<? extends Definition<Object>, ? extends Edge> sourceNode,
                                         final String edgeId); Set<String> lookupTargetNodes(final Graph<?, ? extends Node> graph,
                                         final Node<? extends Definition<Object>, ? extends Edge> sourceNode,
                                         final String edgeId,
                                         final Predicate<String> definitionIdsAllowedFilter); Set<String> lookupMorphBaseDefinitions(final Set<String> definitionIds); @PreDestroy void destroy();  }