This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-toolkit.git

commit 318f31892f66d4523624e3b0eb79a7fba089d638
Author: Daniel Qian <chanjars...@gmail.com>
AuthorDate: Fri Nov 1 16:32:08 2019 +0800

    SCB-1553 Integrate oas-validator compliance check to cli
    Add unit test for validator factories
---
 .../factory/DefaultPathItemValidatorFactory.java   |  4 +-
 .../DefaultComponentsValidatorFactoryTest.java     | 44 ++++++++++++++++++++++
 .../DefaultEncodingValidatorFactoryTest.java       | 44 ++++++++++++++++++++++
 .../factory/DefaultHeaderValidatorFactoryTest.java | 44 ++++++++++++++++++++++
 .../factory/DefaultInfoValidatorFactoryTest.java   | 44 ++++++++++++++++++++++
 .../DefaultMediaTypeValidatorFactoryTest.java      | 44 ++++++++++++++++++++++
 .../DefaultOasSpecValidatorFactoryTest.java        | 41 ++++++++++++++++++++
 .../DefaultOpenApiValidatorFactoryTest.java        | 27 +++++++++++++
 .../DefaultOperationValidatorFactoryTest.java      | 44 ++++++++++++++++++++++
 .../DefaultParameterValidatorFactoryTest.java      | 44 ++++++++++++++++++++++
 .../DefaultPathItemValidatorFactoryTest.java       | 44 ++++++++++++++++++++++
 .../factory/DefaultPathsValidatorFactoryTest.java  | 44 ++++++++++++++++++++++
 .../DefaultRequestBodyValidatorFactoryTest.java    | 44 ++++++++++++++++++++++
 .../DefaultResponseValidatorFactoryTest.java       | 44 ++++++++++++++++++++++
 .../DefaultResponsesValidatorFactoryTest.java      | 44 ++++++++++++++++++++++
 .../factory/DefaultSchemaValidatorFactoryTest.java | 44 ++++++++++++++++++++++
 .../DefaultSecuritySchemeValidatorFactoryTest.java | 44 ++++++++++++++++++++++
 .../factory/DefaultServerValidatorFactoryTest.java | 44 ++++++++++++++++++++++
 .../factory/DefaultTagValidatorFactoryTest.java    | 43 +++++++++++++++++++++
 .../factory/ValidatorFactoryTestConfiguration.java | 26 +++++++++++++
 20 files changed, 799 insertions(+), 2 deletions(-)

diff --git 
a/oas-validator/oas-validator-compliance/src/main/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactory.java
 
b/oas-validator/oas-validator-compliance/src/main/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactory.java
index 8698317..4aa4b05 100644
--- 
a/oas-validator/oas-validator-compliance/src/main/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactory.java
+++ 
b/oas-validator/oas-validator-compliance/src/main/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactory.java
@@ -48,8 +48,8 @@ public class DefaultPathItemValidatorFactory implements 
PathItemValidatorFactory
     ArrayList<PathItemValidator> validators = new ArrayList<>();
 
     // skeletons
-    new PathItemOperationsValidator(operationValidatorFactory.create());
-    new PathItemParametersValidator(parameterValidatorFactory.create());
+    validators.add(new 
PathItemOperationsValidator(operationValidatorFactory.create()));
+    validators.add(new 
PathItemParametersValidator(parameterValidatorFactory.create()));
 
     return Collections.unmodifiableList(validators);
   }
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultComponentsValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultComponentsValidatorFactoryTest.java
new file mode 100644
index 0000000..53642c3
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultComponentsValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.ComponentsValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultComponentsValidatorFactoryTest {
+
+  @Autowired
+  private DefaultComponentsValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<ComponentsValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(14);
+  }
+  
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultEncodingValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultEncodingValidatorFactoryTest.java
new file mode 100644
index 0000000..e8fa711
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultEncodingValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.EncodingValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultEncodingValidatorFactoryTest {
+
+  @Autowired
+  private DefaultEncodingValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<EncodingValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultHeaderValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultHeaderValidatorFactoryTest.java
new file mode 100644
index 0000000..b0448e1
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultHeaderValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.HeaderValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultHeaderValidatorFactoryTest {
+
+  @Autowired
+  private DefaultHeaderValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<HeaderValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultInfoValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultInfoValidatorFactoryTest.java
new file mode 100644
index 0000000..5b7c5b2
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultInfoValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.InfoValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultInfoValidatorFactoryTest {
+
+  @Autowired
+  private DefaultInfoValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<InfoValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(1);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultMediaTypeValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultMediaTypeValidatorFactoryTest.java
new file mode 100644
index 0000000..48f1e15
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultMediaTypeValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.MediaTypeValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultMediaTypeValidatorFactoryTest {
+
+  @Autowired
+  private DefaultMediaTypeValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<MediaTypeValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOasSpecValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOasSpecValidatorFactoryTest.java
new file mode 100644
index 0000000..b62f869
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOasSpecValidatorFactoryTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.OasSpecValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultOasSpecValidatorFactoryTest {
+
+  @Autowired
+  private DefaultOasSpecValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    OasSpecValidator validator = validatorFactory.create();
+    assertThat(validator).isNotNull();
+  }
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOpenApiValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOpenApiValidatorFactoryTest.java
new file mode 100644
index 0000000..7b9f8ef
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOpenApiValidatorFactoryTest.java
@@ -0,0 +1,27 @@
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.OpenApiValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultOpenApiValidatorFactoryTest {
+
+  @Autowired
+  private DefaultOpenApiValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<OpenApiValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(8);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOperationValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOperationValidatorFactoryTest.java
new file mode 100644
index 0000000..2714725
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultOperationValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.OperationValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultOperationValidatorFactoryTest {
+
+  @Autowired
+  private DefaultOperationValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<OperationValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(8);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultParameterValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultParameterValidatorFactoryTest.java
new file mode 100644
index 0000000..e1c201a
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultParameterValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.ParameterValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultParameterValidatorFactoryTest {
+
+  @Autowired
+  private DefaultParameterValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<ParameterValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(7);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactoryTest.java
new file mode 100644
index 0000000..44b53d9
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathItemValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.PathItemValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultPathItemValidatorFactoryTest {
+
+  @Autowired
+  private DefaultPathItemValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<PathItemValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathsValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathsValidatorFactoryTest.java
new file mode 100644
index 0000000..3969b76
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultPathsValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.PathsValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultPathsValidatorFactoryTest {
+
+  @Autowired
+  private DefaultPathsValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<PathsValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultRequestBodyValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultRequestBodyValidatorFactoryTest.java
new file mode 100644
index 0000000..ad94c2c
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultRequestBodyValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.RequestBodyValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultRequestBodyValidatorFactoryTest {
+
+  @Autowired
+  private DefaultRequestBodyValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<RequestBodyValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponseValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponseValidatorFactoryTest.java
new file mode 100644
index 0000000..910a3f4
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponseValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.ResponseValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultResponseValidatorFactoryTest {
+
+  @Autowired
+  private DefaultResponseValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<ResponseValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(3);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponsesValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponsesValidatorFactoryTest.java
new file mode 100644
index 0000000..1e79ef6
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultResponsesValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.ResponsesValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultResponsesValidatorFactoryTest {
+
+  @Autowired
+  private DefaultResponsesValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<ResponsesValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(1);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSchemaValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSchemaValidatorFactoryTest.java
new file mode 100644
index 0000000..fb1e754
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSchemaValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.SchemaValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultSchemaValidatorFactoryTest {
+
+  @Autowired
+  private DefaultSchemaValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<SchemaValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(2);
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSecuritySchemeValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSecuritySchemeValidatorFactoryTest.java
new file mode 100644
index 0000000..b41409f
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultSecuritySchemeValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import 
org.apache.servicecomb.toolkit.oasv.validation.api.SecuritySchemeValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultSecuritySchemeValidatorFactoryTest {
+
+  @Autowired
+  private DefaultSecuritySchemeValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<SecuritySchemeValidator> validators = validatorFactory.create();
+    assertThat(validators).isEmpty();
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultServerValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultServerValidatorFactoryTest.java
new file mode 100644
index 0000000..ec4e193
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultServerValidatorFactoryTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.ServerValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultServerValidatorFactoryTest {
+
+  @Autowired
+  private DefaultServerValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<ServerValidator> validators = validatorFactory.create();
+    assertThat(validators).isEmpty();
+  }
+
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultTagValidatorFactoryTest.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultTagValidatorFactoryTest.java
new file mode 100644
index 0000000..2d98857
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/DefaultTagValidatorFactoryTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.apache.servicecomb.toolkit.oasv.validation.api.TagValidator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = ValidatorFactoryTestConfiguration.class)
+public class DefaultTagValidatorFactoryTest {
+
+  @Autowired
+  private DefaultTagValidatorFactory validatorFactory;
+
+  @Test
+  public void create() {
+    List<TagValidator> validators = validatorFactory.create();
+    assertThat(validators).hasSize(3);
+  }
+}
diff --git 
a/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/ValidatorFactoryTestConfiguration.java
 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/ValidatorFactoryTestConfiguration.java
new file mode 100644
index 0000000..e7b6af9
--- /dev/null
+++ 
b/oas-validator/oas-validator-compliance/src/test/java/org/apache/servicecomb/toolkit/oasv/compliance/factory/ValidatorFactoryTestConfiguration.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.toolkit.oasv.compliance.factory;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ComponentScan
+class ValidatorFactoryTestConfiguration {
+}

Reply via email to