1 package org.onap.so.apihandlerinfra;
4 * ============LICENSE_START=======================================================
6 * ================================================================================
7 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
22 import org.junit.Before;
23 import org.junit.Test;
24 import com.openpojo.reflection.PojoClass;
25 import com.openpojo.reflection.PojoClassFilter;
26 import com.openpojo.reflection.filters.FilterEnum;
27 import com.openpojo.validation.Validator;
28 import com.openpojo.validation.ValidatorBuilder;
29 import com.openpojo.validation.rule.impl.GetterMustExistRule;
30 import com.openpojo.validation.rule.impl.SetterMustExistRule;
31 import com.openpojo.validation.test.impl.GetterTester;
32 import com.openpojo.validation.test.impl.SetterTester;
34 public class BeanMultiTest {
37 PojoClassFilter enumFilter;
38 private PojoClassFilter filterTestClasses = new FilterTestClasses();
42 enumFilter = new FilterEnum();
43 validator = ValidatorBuilder.create().with(new SetterMustExistRule(), new GetterMustExistRule())
44 .with(new SetterTester(), new GetterTester()).build();
48 public void validateBeansMsoApihandlerBeans() {
49 test("org.onap.so.apihandlerinfra.e2eserviceinstancebeans");
50 test("org.onap.so.apihandlerinfra.tasksbeans");
51 test("org.onap.so.apihandlerinfra.vnfbeans");
52 test("org.onap.so.apihandlerinfra.tenantisolationbeans");
53 test("org.onap.so.apihandlerinfra.workflowspecificationbeans");
56 private void test(String packageName) {
57 validator.validate(packageName, enumFilter, filterTestClasses);
61 private static class FilterTestClasses implements PojoClassFilter {
62 public boolean include(PojoClass pojoClass) {
63 return !pojoClass.getSourcePath().contains("/test-classes/");