1 package org.onap.so.apihandlerinfra;
3 * ============LICENSE_START=======================================================
5 * ================================================================================
6 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 import org.junit.Before;
22 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()
44 .with(new SetterMustExistRule(),
45 new GetterMustExistRule())
46 .with(new SetterTester(),
51 public void validateBeansMsoApihandlerBeans() {
52 test("org.onap.so.apihandlerinfra.e2eserviceinstancebeans");
53 test("org.onap.so.apihandlerinfra.tasksbeans");
54 test("org.onap.so.apihandlerinfra.vnfbeans");
55 test("org.onap.so.apihandlerinfra.tenantisolationbeans");
58 private void test(String packageName) {
59 validator.validate(packageName, enumFilter, filterTestClasses);
62 private static class FilterTestClasses implements PojoClassFilter {
63 public boolean include(PojoClass pojoClass) {
64 return !pojoClass.getSourcePath().contains("/test-classes/");