### Question:
ResolverFactory { public Resolver create(PhantomJsResolverOptions options, RepositoryDetails repositoryDetails) { List<Resolver> resolvers = new ArrayList<Resolver>(); if (options.isCheckSystemPath()) { resolvers.add(this.createPathResolver(options)); } if (repositoryDetails != null) { resolvers.add(this.createArchiveResolver(options, repositoryDetails)); } return new CompositeResolver(resolvers); } @Inject  ResolverFactory(InstallerFactory installerFactory,
                         ArchiveFactory archiveFactory,
                         SystemProperties systemProperties); Resolver create(PhantomJsResolverOptions options,
                         RepositoryDetails repositoryDetails);  }### Answer:
@Test public void testGetLocator() { Resolver resolver = resolverFactory.create(options, repositoryDetails); assertThat(resolver).isInstanceOf(CompositeResolver.class); }
@Test public void testCreate_PathResolver() { assumeUnixOs(); when(systemProperties.getPath()).thenReturn(Collections.singletonList(phantomJsBinary.get().getParent())); when(options.isCheckSystemPath()).thenReturn(true); when(options.getVersion()).thenReturn(VERSION); when(options.getEnforceVersion()).thenReturn("true"); Resolver resolver = resolverFactory.create(options, repositoryDetails); assertThat(resolver).isInstanceOf(CompositeResolver.class); String path = resolver.resolve(); }
@Test public void testGetArchiveLocator() { when(options.isCheckSystemPath()).thenReturn(false); when(archiveFactory.create(options)).thenReturn(archive); when(installerFactory.create(options, repositoryDetails)).thenReturn(installer); Resolver resolver = resolverFactory.create(options, repositoryDetails); assertThat(resolver).isInstanceOf(CompositeResolver.class); String path = resolver.resolve(); }