diff options
author | Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> | 2019-08-23 11:12:50 +0200 |
---|---|---|
committer | Tomasz Golabek <tomasz.golabek@nokia.com> | 2019-08-23 13:53:22 +0000 |
commit | 986de50ace41e45664c69a615f4880102197b31a (patch) | |
tree | 7f082cc0407234fe4bc8ab22d91ec56171106cde /common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java | |
parent | 3c3782f1622ddc60c9e17dd6b166e476c38f001b (diff) |
increasing test coverage in common-app-api exception catalog
Issue-ID: SDC-2326
Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com>
Change-Id: I0dd6bc60c88acbcf1b3755627a7b10b874a549ba
Diffstat (limited to 'common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java')
-rw-r--r-- | common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java b/common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java new file mode 100644 index 0000000000..92096e59bd --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/exception/VersionConflictExceptionTest.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2019 Nokia. All rights reserved. + * ================================================================================ + * 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.exception; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import static org.hamcrest.core.Is.is; + +public class VersionConflictExceptionTest { + + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + @Test + public void validateTwoArgConstructorsThrowsCorrectException() { + final String testMessage = "test error message"; + final String testThrowableMessage = "test throwable"; + final Throwable testThrowable = new Throwable(testThrowableMessage); + expectedException.expect(VersionConflictException.class); + expectedException.expectMessage(testMessage); + expectedException.expectCause(is(testThrowable)); + + throw new VersionConflictException(testMessage, testThrowable); + } +} |