diff options
author | 2019-06-25 17:09:18 -0700 | |
---|---|---|
committer | 2019-06-25 17:18:44 -0700 | |
commit | b3f5051484f5b973a47a60fb8f76a67ca5ff88da (patch) | |
tree | e5462cfa264901893c80906c262dcd18633f8b63 /components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java | |
parent | 12e2b43e2219cfccc4c9257d8b601a05c4d9f80a (diff) |
supports multiple Kafka clusters and DBs
Domain classes
Issue-ID: DCAEGEN2-1631
Change-Id: I54a715b2d3d8e13f347e46b0faf9d120d9a60548
Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java')
-rw-r--r-- | components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java index 94eeb085..cec1728e 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/StoreServiceTest.java @@ -35,6 +35,7 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.datalake.feeder.config.ApplicationConfiguration; +import org.onap.datalake.feeder.domain.Kafka; import org.onap.datalake.feeder.dto.TopicConfig; import org.springframework.context.ApplicationContext; @@ -70,6 +71,9 @@ public class StoreServiceTest { @Mock private HdfsService hdfsService; + + @Mock + private Kafka kafka; public void testInit() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException { Method init = storeService.getClass().getDeclaredMethod("init"); @@ -124,29 +128,29 @@ public class StoreServiceTest { List<Pair<Long, String>> messages = new ArrayList<>(); messages.add(Pair.of(100L, "{test: 1}")); - storeService.saveMessages("test1", messages); + storeService.saveMessages(kafka, "test1", messages); //XML List<Pair<Long, String>> messagesXml = new ArrayList<>(); messagesXml.add(Pair.of(100L, "<test></test>")); messagesXml.add(Pair.of(100L, "<test></test"));//bad xml to trigger exception - storeService.saveMessages("test2", messagesXml); + storeService.saveMessages(kafka, "test2", messagesXml); //YAML List<Pair<Long, String>> messagesYaml = new ArrayList<>(); messagesYaml.add(Pair.of(100L, "test: yes")); - storeService.saveMessages("test3", messagesYaml); + storeService.saveMessages(kafka, "test3", messagesYaml); //TEXT List<Pair<Long, String>> messagesText = new ArrayList<>(); messagesText.add(Pair.of(100L, "test message")); - storeService.saveMessages("test4", messagesText); + storeService.saveMessages(kafka, "test4", messagesText); //Null mesg - storeService.saveMessages("test", null); + storeService.saveMessages(kafka, "test", null); } @Test |