aboutsummaryrefslogtreecommitdiffstats
path: root/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java')
-rw-r--r--prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java
index fad18699..2e323c5e 100644
--- a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java
+++ b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClientTest.java
@@ -19,8 +19,12 @@
*/
package org.onap.dcaegen2.services.prh.service;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
+import org.onap.dcaegen2.services.prh.config.DmaapConsumerConfiguration;
import org.springframework.web.reactive.function.client.WebClient;
/**
@@ -28,19 +32,23 @@ import org.springframework.web.reactive.function.client.WebClient;
*/
public class DMaaPReactiveWebClientTest {
+
@Test
public void builder_shouldBuildDMaaPReactiveWebClient() {
//given
+ DmaapConsumerConfiguration dmaapConsumerConfiguration = mock(DmaapConsumerConfiguration.class);
WebClient dMaaPReactiveWebClient;
String dMaaPContentType = "*/*";
String dMaaPUserName = "DMaaP";
String dMaaPUserPassword = "DMaaP";
//when
- dMaaPReactiveWebClient = new DMaaPReactiveWebClient.WebClientBuilder()
- .dmaapContentType(dMaaPContentType)
- .dmaapUserName(dMaaPUserName)
- .dmaapUserPassword(dMaaPUserPassword).build();
+ when(dmaapConsumerConfiguration.dmaapContentType()).thenReturn(dMaaPContentType);
+ when(dmaapConsumerConfiguration.dmaapUserName()).thenReturn(dMaaPUserName);
+ when(dmaapConsumerConfiguration.dmaapUserPassword()).thenReturn(dMaaPUserPassword);
+ dMaaPReactiveWebClient = new DMaaPReactiveWebClient()
+ .fromConfiguration(dmaapConsumerConfiguration)
+ .build();
//then
Assertions.assertNotNull(dMaaPReactiveWebClient);