Remove unused dcae-be healthcheck
[sdc.git] / common-app-api / src / test / java / org / openecomp / sdc / fe / config / ConfigurationTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2019 Nokia.
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
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
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=========================================================
20  */
21
22 package org.openecomp.sdc.fe.config;
23
24 import org.junit.Test;
25
26 import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
27 import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
28 import static org.hamcrest.CoreMatchers.allOf;
29 import static org.hamcrest.MatcherAssert.assertThat;
30 import static org.junit.Assert.assertEquals;
31
32
33 public class ConfigurationTest {
34
35         @Test
36         public void validateBean() {
37                 assertThat(Configuration.class, allOf(
38                                 hasValidBeanConstructor(),
39                                 hasValidGettersAndSetters()
40                 ));
41         }
42
43         @Test
44         public void validateFeMonitoringConfigBean() {
45                 assertThat(Configuration.FeMonitoringConfig.class, allOf(
46                                 hasValidBeanConstructor(),
47                                 hasValidGettersAndSetters()
48                 ));
49         }
50
51         @Test
52         public void validateOnboardingConfigBean() {
53                 assertThat(Configuration.OnboardingConfig.class, allOf(
54                                 hasValidBeanConstructor(),
55                                 hasValidGettersAndSetters()
56                 ));
57         }
58
59         @Test
60         public void validateGetHealthCheckSocketTimeoutInMsReturnsProperTime() {
61                 final int defaultTestTimeout = 100;
62                 final int setTestTimeout = 1000;
63                 Configuration configuration = new Configuration();
64
65                 assertEquals(configuration.getHealthCheckSocketTimeoutInMs(defaultTestTimeout).intValue(),defaultTestTimeout);
66
67                 configuration.setHealthCheckSocketTimeoutInMs(setTestTimeout);
68                 assertEquals(configuration.getHealthCheckSocketTimeoutInMs(defaultTestTimeout).intValue(),setTestTimeout);
69         }
70
71         @Test
72         public void validateGetHealthCheckIntervalInSecondsReturnsProperTime() {
73                 final int defaultTestTimeout = 1;
74                 final int setTestTimeout = 2;
75                 Configuration configuration = new Configuration();
76
77                 assertEquals(configuration.getHealthCheckIntervalInSeconds(defaultTestTimeout).intValue(),defaultTestTimeout);
78
79                 configuration.setHealthCheckIntervalInSeconds(setTestTimeout);
80                 assertEquals(configuration.getHealthCheckIntervalInSeconds(defaultTestTimeout).intValue(),setTestTimeout);
81         }
82 }