diff options
Diffstat (limited to 'src/test/java/org/onap/aai/validation/TestApplication.java')
-rw-r--r-- | src/test/java/org/onap/aai/validation/TestApplication.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/test/java/org/onap/aai/validation/TestApplication.java b/src/test/java/org/onap/aai/validation/TestApplication.java index 26d480a..3dfa177 100644 --- a/src/test/java/org/onap/aai/validation/TestApplication.java +++ b/src/test/java/org/onap/aai/validation/TestApplication.java @@ -1,7 +1,10 @@ /** - * ============LICENSE_START=================================================== + * ============LICENSE_START======================================================= + * org.onap.aai + * ================================================================================ + * Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved. * Copyright (c) 2018-2019 European Software Marketing Ltd. - * ============================================================================ + * ================================================================================ * 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 @@ -13,7 +16,7 @@ * 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===================================================== + * ============LICENSE_END========================================================= */ package org.onap.aai.validation; @@ -21,11 +24,17 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestPropertySource; /** * Invoke the Spring Boot Application (primarily for code coverage). * */ +@SpringBootTest(classes = ValidationServiceApplication.class) +@TestPropertySource(locations = {"classpath:oxm-reader/schemaIngest.properties", "classpath:application.properties"}) +@ContextConfiguration(locations = {"classpath:validation-service-beans.xml"}) public class TestApplication { @Rule @@ -35,6 +44,7 @@ public class TestApplication { public void init() { System.setProperty("CONFIG_HOME", "src/test/resources/model-validation/instance-validator"); System.setProperty("APP_HOME", "."); + System.setProperty("schema.translator.list", "config"); System.clearProperty("KEY_STORE_PASSWORD"); } @@ -46,4 +56,11 @@ public class TestApplication { ValidationServiceApplication.main(null); } + @Test + public void testApplicationWithNullKeyStorePassword() { + expectedEx.expect(IllegalArgumentException.class); + expectedEx.expectMessage("roperty KEY_STORE_PASSWORD not set"); + ValidationServiceApplication.main(new String[] {}); + } + } |