aboutsummaryrefslogtreecommitdiffstats
path: root/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/RequestErrorTest.java
blob: c752c765645e98fdb564fef2efd361128930d85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.onap.ccsdk.sli.adaptors.aai.data;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class RequestErrorTest {

	RequestError _reInstance;
	protected ServiceException  _serviceException;
	protected Map<String, Object> _additionalProperties;
	
	@Before
	public void setUp() throws Exception {
		_reInstance = new RequestError();
		_serviceException = mock(ServiceException.class);
		_additionalProperties = new HashMap<String, Object>() {{
			put("prop1", "propvalue1");
			put("prop2", "propvalue2");
		}};
	}

	@After
	public void tearDown() throws Exception {
		_reInstance = null;
		_serviceException = null;
		_additionalProperties = null;
	}

	@Test
	public void testSetServiceException() {
		_reInstance.setServiceException(_serviceException);
		assertEquals(_reInstance.getServiceException(), _serviceException);
	}

	@Test
	public void testSetAdditionalProperty() {
		_reInstance.setAdditionalProperty("prop1", "propvalue1");
		_reInstance.setAdditionalProperty("prop2", "propvalue2");
		assertEquals(_reInstance.getAdditionalProperties(), _additionalProperties);
	}

}