e2a62c0e87b0077efde8f547e23863ffdf097ae9
[vid.git] / vid-app-common / src / test / java / org / onap / vid / aai / model / PnfPropertiesTest.java
1 package org.onap.vid.aai.model;
2
3 import org.codehaus.jackson.map.ObjectMapper;
4 import org.junit.Before;
5 import org.junit.Test;
6
7 import java.io.IOException;
8 import java.util.ArrayList;
9
10 import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
11 import static org.hamcrest.MatcherAssert.assertThat;
12 import static org.hamcrest.core.StringContains.containsString;
13
14 public class PnfPropertiesTest {
15
16     private PnfProperties pnfProperties;
17
18     @Before
19     public void setUp(){
20         pnfProperties = new PnfProperties();
21         pnfProperties.setAdditionalProperty("key1", "value1");
22         pnfProperties.setAdditionalProperty("key2", "value2");
23     }
24
25     @Test
26     public void shouldHaveValidGettersAndSetters() throws IOException {
27         String result = new ObjectMapper().writeValueAsString(pnfProperties);
28         assertThat(result, containsString("key1"));
29         assertThat(result, containsString("value2"));
30         assertThat(result, containsString("key2"));
31         assertThat(result, containsString("value2"));
32     }
33 }