summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/test')
-rw-r--r--mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
new file mode 100644
index 0000000000..fdbc04acb4
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
@@ -0,0 +1,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));
+ }
+}