### Question:
DefaultOperationValidatorFactory implements OperationValidatorFactory { @Override public List<OperationValidator> create(FactoryOptions options) { List<OperationValidator> validators = new ArrayList<>(); validators.add(new OperationParametersValidator(parameterValidatorFactory.create(options))); validators.add(new OperationResponsesValidator(responsesValidatorFactory.create(options))); validators.add(new OperationRequestBodyValidator(requestBodyValidatorFactory.create(options))); addOperationSummaryRequiredValidator(validators, options); addOperationIdCaseValidator(validators, options); addOperationTagsSizeEqValidator(validators, options); addOperationServersSizeEqValidator(validators, options); addOperationTagsReferenceValidator(validators, options); return Collections.unmodifiableList(validators); } DefaultOperationValidatorFactory(
      ParameterValidatorFactory parameterValidatorFactory,
      ResponsesValidatorFactory responsesValidatorFactory,
      RequestBodyValidatorFactory requestBodyValidatorFactory); @Override List<OperationValidator> create(FactoryOptions options);  }### Answer:
@Test public void create() { FactoryOptions options = new FactoryOptions(emptyMap()); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class ); }
@Test public void create1() { FactoryOptions options = new FactoryOptions(singletonMap(OperationSummaryRequiredValidator.CONFIG_KEY, "true")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(4); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class, OperationSummaryRequiredValidator.class ); }
@Test public void create2() { FactoryOptions options = new FactoryOptions(singletonMap(OperationSummaryRequiredValidator.CONFIG_KEY, "false")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class ); }
@Test public void creat3() { FactoryOptions options = new FactoryOptions(singletonMap(OperationIdCaseValidator.CONFIG_KEY, "upper-camel-case")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(4); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class, OperationIdCaseValidator.class ); }
@Test public void creat4() { FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsSizeEqValidator.CONFIG_KEY, "1")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(4); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class, OperationTagsSizeEqValidator.class ); }
@Test public void create5() { FactoryOptions options = new FactoryOptions(singletonMap(OperationServersSizeEqValidator.CONFIG_KEY, "1")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(4); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class, OperationServersSizeEqValidator.class ); }
@Test public void create6() { FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsReferenceValidator.CONFIG_KEY, "true")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(4); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class, OperationTagsReferenceValidator.class ); }
@Test public void create7() { FactoryOptions options = new FactoryOptions(singletonMap(OperationTagsReferenceValidator.CONFIG_KEY, "false")); List<OperationValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(3); assertThat(validators).hasOnlyElementsOfTypes( OperationParametersValidator.class, OperationResponsesValidator.class, OperationRequestBodyValidator.class ); }