GithubFactoryParametersResolver extends DefaultFactoryParameterResolver { @Override public boolean accept(@NotNull final Map<String, String> factoryParameters) { return factoryParameters.containsKey(URL_PARAMETER_NAME) && githubUrlParser.isValid(factoryParameters.get(URL_PARAMETER_NAME)); } @Inject  GithubFactoryParametersResolver(
      GithubURLParser githubUrlParser,
      URLFetcher urlFetcher,
      GithubSourceStorageBuilder githubSourceStorageBuilder,
      URLFactoryBuilder urlFactoryBuilder,
      ProjectConfigDtoMerger projectConfigDtoMerger); @Override boolean accept(@NotNull final Map<String, String> factoryParameters); @Override FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters);  }
@Test public void checkMissingParameter() { Map<String, String> parameters = singletonMap("foo", "this is a foo bar"); boolean accept = githubFactoryParametersResolver.accept(parameters); assertFalse(accept); }
@Test public void checkInvalidAcceptUrl() { Map<String, String> parameters = singletonMap(URL_PARAMETER_NAME, "http: boolean accept = githubFactoryParametersResolver.accept(parameters); assertFalse(accept); }
@Test public void checkValidAcceptUrl() { Map<String, String> parameters = singletonMap(URL_PARAMETER_NAME, "https: boolean accept = githubFactoryParametersResolver.accept(parameters); assertTrue(accept); }