Revert "vLAN . Support Policies."
[sdc/sdc-tosca.git] / src / test / java / org / openecomp / sdc / impl / ToscaParserServiceInputTest.java
1 package org.openecomp.sdc.impl;
2
3 import org.testng.annotations.Test;
4 import org.openecomp.sdc.toscaparser.api.parameters.Input;
5
6 import java.util.List;
7
8 import static org.testng.Assert.assertEquals;
9 import static org.testng.Assert.assertNotNull;
10 import static org.testng.Assert.assertNull;
11
12 public class ToscaParserServiceInputTest extends SdcToscaParserBasicTest {
13
14     //region getServiceInputs
15     @Test
16     public void testGetServiceInputs(){
17         List<Input> serviceInputs = fdntCsarHelper.getServiceInputs();
18         assertNotNull(serviceInputs);
19         assertEquals(1, serviceInputs.size());
20     }
21
22     @Test
23     public void testServiceInputs() {
24         List<Input> inputs = rainyCsarHelperSingleVf.getServiceInputs();
25         assertNotNull(inputs);
26         assertEquals(0, inputs.size());
27     }
28     //endregion
29
30     //region getServiceInputLeafValueOfDefault
31     @Test
32     public void testGetServiceInputLeafValue(){
33         String serviceInputLeafValue = fdntCsarHelper.getServiceInputLeafValueOfDefault("service_naming#default");
34         assertEquals("test service naming", serviceInputLeafValue);
35     }
36
37 //    @Test
38 //    public void testGetServiceInputLeafValueWithGetInput(){
39 //        String serviceInputLeafValue = fdntCsarHelperWithInputs.getServiceInputLeafValueOfDefault("my_input#default");
40 //        assertEquals(null, serviceInputLeafValue);
41 //    }
42
43     @Test
44     public void testGetServiceInputLeafValueNotExists(){
45         String serviceInputLeafValue = fdntCsarHelper.getServiceInputLeafValueOfDefault("service_naming#default#kuku");
46         assertNull(serviceInputLeafValue);
47     }
48
49     @Test
50     public void testGetServiceInputLeafValueNull(){
51         String serviceInputLeafValue = fdntCsarHelper.getServiceInputLeafValueOfDefault(null);
52         assertNull(serviceInputLeafValue);
53     }
54     //endregion
55
56     //region getServiceInputLeafValueOfDefaultAsObject
57     @Test
58     public void testGetServiceInputLeafValueOfDefaultAsObject() {
59         Object serviceInputLeafValue = fdntCsarHelper.getServiceInputLeafValueOfDefault("service_naming#default");
60         assertEquals("test service naming", serviceInputLeafValue);
61     }
62     
63     @Test
64     public void testGetServiceComplexInputLeafValueOfDefault() {
65         String serviceInputLeafValue = fdntCsarHelperWithInputs.getServiceInputLeafValueOfDefault("complex_input#default#ipv4_subnet_default_assignment#cidr_mask");
66         assertEquals(serviceInputLeafValue, "24");
67     }
68     
69     @Test
70     public void testGetServiceDummyComplexInputLeafValueOfDefault() {
71         String serviceInputLeafValue = fdntCsarHelperWithInputs.getServiceInputLeafValueOfDefault("complex_input#default#ipv4_subnet_default_assignment#XXX");
72         assertNull(serviceInputLeafValue);
73     }
74     
75     
76     //endregion
77 }