summaryrefslogtreecommitdiffstats
path: root/common-app-api/src/test/java/org
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-03-17 14:57:07 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-18 09:31:22 +0000
commit49de015b6b49f64516557254e1e3713448ca4e6c (patch)
tree8ec7fca563a0d7af11c4f4cb1a550c65608f9cc6 /common-app-api/src/test/java/org
parenta54b7c89ae8441e749cc08489672c50cfbe5786f (diff)
Improve test coverage
Use Lombok annotations to improve test coverage Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Iaaed0023960cfe0a31e1b50fb868196ab488cb4c Issue-ID: SDC-3428
Diffstat (limited to 'common-app-api/src/test/java/org')
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java150
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java82
2 files changed, 0 insertions, 232 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java
deleted file mode 100644
index 23e0ab8439..0000000000
--- a/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nokia.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.be.config;
-
-import org.junit.Test;
-
-import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
-import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-public class ConfigurationTest {
- public void validateBean() {
- assertThat(Configuration.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding(
- "excludedGroupTypesMapping",
- "excludedPolicyTypesMapping",
- "skipUpgradeVSPs",
- "skipUpgradeVSPsFlag",
- "supportAllottedResourcesAndProxy",
- "supportAllottedResourcesAndProxyFlag")
- ));
- }
- @Test
- public void validateBeanForCassandrConfig() {
- assertThat(Configuration.CassandrConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForSwitchoverDetectorConfig() {
- assertThat(Configuration.SwitchoverDetectorConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForBeMonitoringConfig() {
- assertThat(Configuration.BeMonitoringConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForArtifactTypeConfig() {
- assertThat(Configuration.ArtifactTypeConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForOnboardingConfig() {
- assertThat(Configuration.OnboardingConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForEcompPortalConfig() {
- assertThat(Configuration.EcompPortalConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForApplicationL1CacheConfig() {
- assertThat(Configuration.ApplicationL1CacheConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForApplicationL2CacheConfig() {
- assertThat(Configuration.ApplicationL2CacheConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForToscaValidatorsConfig() {
- assertThat(Configuration.ToscaValidatorsConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForApplicationL1CacheInfo() {
- assertThat(Configuration.ApplicationL1CacheInfo.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForApplicationL1CacheCatalogInfo() {
- assertThat(Configuration.ApplicationL1CacheCatalogInfo.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForQueueInfo() {
- assertThat(Configuration.QueueInfo.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForEnvironmentContext() {
- assertThat(Configuration.EnvironmentContext.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForPathsAndNamesDefinition() {
- assertThat(Configuration.PathsAndNamesDefinition.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
- @Test
- public void validateBeanForGabConfig() {
- assertThat(Configuration.GabConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSettersExcluding()
- ));
- }
-
-}
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java
deleted file mode 100644
index ae30ccf502..0000000000
--- a/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nokia.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.fe.config;
-
-import org.junit.Test;
-
-import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
-import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-
-
-public class ConfigurationTest {
-
- @Test
- public void validateBean() {
- assertThat(Configuration.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSetters()
- ));
- }
-
- @Test
- public void validateFeMonitoringConfigBean() {
- assertThat(Configuration.FeMonitoringConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSetters()
- ));
- }
-
- @Test
- public void validateOnboardingConfigBean() {
- assertThat(Configuration.OnboardingConfig.class, allOf(
- hasValidBeanConstructor(),
- hasValidGettersAndSetters()
- ));
- }
-
- @Test
- public void validateGetHealthCheckSocketTimeoutInMsReturnsProperTime() {
- final int defaultTestTimeout = 100;
- final int setTestTimeout = 1000;
- Configuration configuration = new Configuration();
-
- assertEquals(configuration.getHealthCheckSocketTimeoutInMs(defaultTestTimeout).intValue(),defaultTestTimeout);
-
- configuration.setHealthCheckSocketTimeoutInMs(setTestTimeout);
- assertEquals(configuration.getHealthCheckSocketTimeoutInMs(defaultTestTimeout).intValue(),setTestTimeout);
- }
-
- @Test
- public void validateGetHealthCheckIntervalInSecondsReturnsProperTime() {
- final int defaultTestTimeout = 1;
- final int setTestTimeout = 2;
- Configuration configuration = new Configuration();
-
- assertEquals(configuration.getHealthCheckIntervalInSeconds(defaultTestTimeout).intValue(),defaultTestTimeout);
-
- configuration.setHealthCheckIntervalInSeconds(setTestTimeout);
- assertEquals(configuration.getHealthCheckIntervalInSeconds(defaultTestTimeout).intValue(),setTestTimeout);
- }
-}