@Test(expected = IllegalStateException.class) public void create_noServices() { underTest.create(classLoader); fail(); }
public GroovyRuntime create(final ClassLoader classLoader) { checkNotNull(classLoader); Iterator<GroovyRuntime> services = findServices(classLoader); checkState(services.hasNext(), "No GroovyRuntime service found"); GroovyRuntime runtime = services.next(); checkState(!services.hasNext(), "Multiple GroovyRuntime services found"); log.debug("Runtime: {}", runtime); return runtime; }
GroovyRuntimeFactory { public GroovyRuntime create(final ClassLoader classLoader) { checkNotNull(classLoader); Iterator<GroovyRuntime> services = findServices(classLoader); checkState(services.hasNext(), "No GroovyRuntime service found"); GroovyRuntime runtime = services.next(); checkState(!services.hasNext(), "Multiple GroovyRuntime services found"); log.debug("Runtime: {}", runtime); return runtime; } }
GroovyRuntimeFactory { public GroovyRuntime create(final ClassLoader classLoader) { checkNotNull(classLoader); Iterator<GroovyRuntime> services = findServices(classLoader); checkState(services.hasNext(), "No GroovyRuntime service found"); GroovyRuntime runtime = services.next(); checkState(!services.hasNext(), "Multiple GroovyRuntime services found"); log.debug("Runtime: {}", runtime); return runtime; }  }
GroovyRuntimeFactory { public GroovyRuntime create(final ClassLoader classLoader) { checkNotNull(classLoader); Iterator<GroovyRuntime> services = findServices(classLoader); checkState(services.hasNext(), "No GroovyRuntime service found"); GroovyRuntime runtime = services.next(); checkState(!services.hasNext(), "Multiple GroovyRuntime services found"); log.debug("Runtime: {}", runtime); return runtime; }  GroovyRuntime create(final ClassLoader classLoader); }
GroovyRuntimeFactory { public GroovyRuntime create(final ClassLoader classLoader) { checkNotNull(classLoader); Iterator<GroovyRuntime> services = findServices(classLoader); checkState(services.hasNext(), "No GroovyRuntime service found"); GroovyRuntime runtime = services.next(); checkState(!services.hasNext(), "Multiple GroovyRuntime services found"); log.debug("Runtime: {}", runtime); return runtime; }  GroovyRuntime create(final ClassLoader classLoader);  }