### Question:
DefaultParameterValidatorFactory implements ParameterValidatorFactory { @Override public List<ParameterValidator> create(FactoryOptions options) { List<ParameterValidator> validators = new ArrayList<>(); validators.add(new ParameterSchemaValidator(schemaValidatorFactory.create(options))); validators.add(new ParameterContentValidator(mediaTypeValidatorFactory.create(options))); addParameterNameCookieCaseValidator(validators, options); addParameterNameHeaderCaseValidator(validators, options); addParameterNamePathCaseValidator(validators, options); addParameterNameQueryCaseValidator(validators, options); addParameterDescriptionRequiredValidator(validators, options); return Collections.unmodifiableList(validators); } DefaultParameterValidatorFactory(
      SchemaValidatorFactory schemaValidatorFactory,
      MediaTypeValidatorFactory mediaTypeValidatorFactory); @Override List<ParameterValidator> create(FactoryOptions options);  }### Answer:
@Test public void create() { FactoryOptions options = new FactoryOptions(emptyMap()); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(2); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class ); }
@Test public void create1() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterNameCookieCaseValidator.CONFIG_KEY, "upper-camel-case")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class, ParameterNameCookieCaseValidator.class ); }
@Test public void create2() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterNameHeaderCaseValidator.CONFIG_KEY, "upper-camel-case")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class, ParameterNameHeaderCaseValidator.class ); }
@Test public void create3() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterNamePathCaseValidator.CONFIG_KEY, "upper-camel-case")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class, ParameterNamePathCaseValidator.class ); }
@Test public void create4() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterNameQueryCaseValidator.CONFIG_KEY, "upper-camel-case")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class, ParameterNameQueryCaseValidator.class ); }
@Test public void create5() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterDescriptionRequiredValidator.CONFIG_KEY, "true")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class, ParameterDescriptionRequiredValidator.class ); }
@Test public void create6() { FactoryOptions options = new FactoryOptions( singletonMap(ParameterDescriptionRequiredValidator.CONFIG_KEY, "false")); List<ParameterValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(2); assertThat(validators).hasOnlyElementsOfTypes( ParameterSchemaValidator.class, ParameterContentValidator.class ); }