Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / so-bpmn-infrastructure-common / src / test / java / org / onap / so / bpmn / infrastructure / workflow / serviceTask / client / entity / ClientEntityPojoTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
22
23 import org.junit.Test;
24 import com.openpojo.reflection.PojoClass;
25 import com.openpojo.reflection.impl.PojoClassFactory;
26 import com.openpojo.validation.Validator;
27 import com.openpojo.validation.ValidatorBuilder;
28 import com.openpojo.validation.rule.impl.GetterMustExistRule;
29 import com.openpojo.validation.rule.impl.NoNestedClassRule;
30 import com.openpojo.validation.rule.impl.NoPrimitivesRule;
31 import com.openpojo.validation.rule.impl.NoPublicFieldsRule;
32 import com.openpojo.validation.rule.impl.SetterMustExistRule;
33 import com.openpojo.validation.test.impl.DefaultValuesNullTester;
34 import com.openpojo.validation.test.impl.GetterTester;
35 import com.openpojo.validation.test.impl.SetterTester;
36
37 public class ClientEntityPojoTest {
38     @Test
39     public void pojoStructure() {
40         test(PojoClassFactory.getPojoClass(NetworkInformationEntity.class));
41         test(PojoClassFactory.getPojoClass(NetworkInputParametersEntity.class));
42         test(PojoClassFactory.getPojoClass(NetworkRequestInputEntity.class));
43         test(PojoClassFactory.getPojoClass(NetworkResponseInformationEntity.class));
44         test(PojoClassFactory.getPojoClass(NetworkTopologyOperationInputEntity.class));
45         test(PojoClassFactory.getPojoClass(NetworkTopologyOperationOutputEntity.class));
46         test(PojoClassFactory.getPojoClass(OnapModelInformationEntity.class));
47         test(PojoClassFactory.getPojoClass(ParamEntity.class));
48         test(PojoClassFactory.getPojoClass(RequestInformationEntity.class));
49         test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationInputEntity.class));
50         test(PojoClassFactory.getPojoClass(SdncRequestHeaderEntity.class));
51         test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationInputEntity.class));
52         test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationOutputEntity.class));
53         test(PojoClassFactory.getPojoClass(ServiceInformationEntity.class));
54         test(PojoClassFactory.getPojoClass(ServiceInputParametersEntity.class));
55         test(PojoClassFactory.getPojoClass(ServiceRequestInputEntity.class));
56         test(PojoClassFactory.getPojoClass(ServiceResponseInformationEntity.class));
57         test(PojoClassFactory.getPojoClass(ServiceTopologyOperationInputEntity.class));
58         test(PojoClassFactory.getPojoClass(ServiceTopologyOperationOutputEntity.class));
59         test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationOutputEntity.class));
60     }
61
62     private void test(PojoClass pojoClass) {
63         Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterMustExistRule())
64                 .with(new NoNestedClassRule()).with(new NoPrimitivesRule()).with(new NoPublicFieldsRule())
65                 .with(new SetterTester()).with(new GetterTester()).with(new DefaultValuesNullTester()).build();
66         validator.validate(pojoClass);
67     }
68 }