blob: 027c47e6f3fc8812f3e4763340fcedba4b7a0732 [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM
4 * ================================================================================
5 * Copyright (C) 2018 AT&T
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
21
22
23package org.onap.osam.aai.model;
24
25import java.io.IOException;
26
27
28import com.fasterxml.jackson.databind.ObjectMapper;
29import org.junit.Before;
30import org.junit.Test;
31
32import static org.hamcrest.MatcherAssert.assertThat;
33import static org.hamcrest.core.StringContains.containsString;
34
35public class PnfResultTest {
36
37 private PnfResult pnfResult;
38
39 @Before
40 public void setUp(){
41 pnfResult = new PnfResult();
42 pnfResult.setAdditionalProperty("key1", "value1");
43 pnfResult.setAdditionalProperty("key2", "value2");
44 }
45
46 @Test
47 public void shouldHaveValidGettersAndSetters() throws IOException {
48 String result = new ObjectMapper().writeValueAsString(pnfResult);
49 assertThat(result, containsString("key1"));
50 assertThat(result, containsString("value2"));
51 assertThat(result, containsString("key2"));
52 assertThat(result, containsString("value2"));
53 }
54}