blob: fdbc04acb499dcf26648dd08c7f1448c518dc56d (
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
|
package org.onap.so.db.request.client;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.times;
import java.net.URI;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.springframework.http.HttpEntity;
import org.springframework.web.client.RestTemplate;
@RunWith(MockitoJUnitRunner.class)
public class RequestDbClientTest {
@InjectMocks
protected RequestsDbClient requestsDbClient;
@Mock
protected RestTemplate restTemplate;
@Test
public void updateRequestProcessingDataTest() {
RequestProcessingData requestProcessingData = new RequestProcessingData();
requestProcessingData.setId(1);
URI uri = URI.create("/requestProcessingData/1");
requestsDbClient.updateRequestProcessingData(requestProcessingData);
Mockito.verify(restTemplate, times(1)).put(eq(uri), isA(HttpEntity.class));
}
}
|