Sorted out unit-test libraries in onboarding
[sdc.git] / openecomp-be / lib / openecomp-sdc-validation-lib / openecomp-sdc-validation-impl / src / test / java / org / openecomp / sdc / validation / impl / validators / HeatResourceValidatorTest.java
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.validation.impl.validators;
18
19 import java.util.Map;
20 import org.junit.Assert;
21 import org.junit.Test;
22 import org.openecomp.core.validation.types.MessageContainer;
23 import org.openecomp.sdc.validation.Validator;
24 import org.openecomp.sdc.validation.util.ValidationTestUtil;
25
26 public class HeatResourceValidatorTest {
27
28   Validator validator=new HeatResourceValidator();
29
30   @Test
31   public void testParseException(){
32     Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(validator,
33         "/org/openecomp/validation/validators/guideLineValidator/baseHeatDoesNotExposeNetwork/parseException/");
34     Assert.assertEquals(messages.size(), 1);
35     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
36         "ERROR: [RBV2]: Invalid HEAT format problem - [while scanning for the next token\n" +
37             "found character '\\t(TAB)' that cannot start any token. (Do not use \\t(TAB) for indentation)\n" +
38             " in 'reader', line 5, column 1:\n" +
39             "    \t\t\tresources:\n" +
40             "    ^\n" +
41             "]");
42   }
43 }