ScannerImpl implements Scanner { @Override public Scope resolveScope(String name) { if (name == null) { return DefaultScope.NONE; } Scope scope = scannerPluginRepository.getScopes().get(name); if (scope == null) { LOGGER.warn("No scope found for name '" + name + "'."); scope = DefaultScope.NONE; } return scope; } ScannerImpl(ScannerConfiguration configuration, Map<String, Object> pluginProperties, ScannerContext scannerContext,
            ScannerPluginRepository scannerPluginRepository); @Override D scan(final I item, final String path, final Scope scope); @Override D scan(I item, D descriptor, String path, Scope scope); @Override ScannerContext getContext(); @Override Scope resolveScope(String name);  }
@Test public void resolveScope() { ScannerContext scannerContext = mock(ScannerContext.class); Scanner scanner = new ScannerImpl(new ScannerConfiguration(), emptyMap(), scannerContext, scannerPluginRepository); Assert.assertThat(scanner.resolveScope("default:none"), equalTo(DefaultScope.NONE)); Assert.assertThat(scanner.resolveScope("unknown"), equalTo(DefaultScope.NONE)); Assert.assertThat(scanner.resolveScope(null), equalTo(DefaultScope.NONE)); }