GitlabFactoryParametersResolver implements FactoryParametersResolver { @Override public boolean accept(@NotNull final Map<String, String> factoryParameters) { return factoryParameters.containsKey(URL_PARAMETER_NAME) && gitlabUrlParser.isValid(factoryParameters.get(URL_PARAMETER_NAME)); }  @Override boolean accept(@NotNull final Map<String, String> factoryParameters); @Override FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters);  }
@Test public void checkMissingParameter() throws BadRequestException { Map<String, String> parameters = singletonMap("foo", "this is a foo bar"); boolean accept = gitlabFactoryParametersResolver.accept(parameters); assertFalse(accept); }
@Test public void checkInvalidAcceptUrl() throws BadRequestException { Map<String, String> parameters = singletonMap(URL_PARAMETER_NAME, "http: boolean accept = gitlabFactoryParametersResolver.accept(parameters); assertFalse(accept); }
@Test public void checkValidAcceptUrl() throws BadRequestException { Map<String, String> parameters = singletonMap(URL_PARAMETER_NAME, "https: boolean accept = gitlabFactoryParametersResolver.accept(parameters); assertTrue(accept); }