diff options
author | Guobiao Mo <guobiaomo@chinamobile.com> | 2019-05-13 11:58:33 -0700 |
---|---|---|
committer | Guobiao Mo <guobiaomo@chinamobile.com> | 2019-05-13 11:58:33 -0700 |
commit | 3208e0c943742fef5e6692202063dba4e8ab96fd (patch) | |
tree | 4c2249402badfcc430425cd2bd7369b9f1465543 /components/datalake-handler/feeder/src/test/java/org | |
parent | 59e2cb0714953e91f5a6c29c58fb935f44975442 (diff) |
Support HDFS as a data store
Issue-ID: DCAEGEN2-1498
Change-Id: Id203275bce01bd4a4d6ec131fb9696d78eda82f5
Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'components/datalake-handler/feeder/src/test/java/org')
4 files changed, 17 insertions, 4 deletions
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java index c4a5b1bf..7243a8e6 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/config/ApplicationConfigurationTest.java @@ -26,7 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -60,12 +59,20 @@ public class ApplicationConfigurationTest { assertTrue(config.getDmaapCheckNewTopicIntervalInSec() > 0); assertTrue(config.getKafkaConsumerCount() > 0); + + assertNotNull(config.getDmaapKafkaExclude()); + assertNotNull(config.isAsync()); assertNotNull(config.isEnableSSL()); assertNotNull(config.getDefaultTopicName()); assertNotNull(config.getRawDataLabel()); assertNotNull(config.getTimestampLabel()); - assertEquals(null, config.getElasticsearchType()); + assertNotNull(config.getElasticsearchType()); + + //HDFS + assertTrue(config.getHdfsBatchSize()>0); + assertTrue(config.getHdfsBufferSize()>0); + assertTrue(config.getHdfsFlushInterval()>0); } } diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java index dc9feedc..bb31cd74 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java @@ -99,6 +99,7 @@ public class TopicConfigTest { assertFalse(testTopicConfig.supportCouchbase()); assertFalse(testTopicConfig.supportDruid()); assertFalse(testTopicConfig.supportMongoDB()); + assertFalse(testTopicConfig.supportHdfs()); testTopic.getDbs().remove(new Db("Elasticsearch")); testTopicConfig = testTopic.getTopicConfig(); diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DbServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DbServiceTest.java index 4948001f..8aa60abc 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DbServiceTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/DbServiceTest.java @@ -91,4 +91,11 @@ public class DbServiceTest { assertEquals(dbService.getDruid(), new Db(name)); } + @Test + public void testGetHdfs() { + String name = "HDFS"; + when(dbRepository.findById(name)).thenReturn(Optional.of(new Db(name))); + assertEquals(dbService.getHdfs(), new Db(name)); + } + } diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullServiceTest.java index 020bcc55..8519bfbb 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullServiceTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/PullServiceTest.java @@ -46,8 +46,6 @@ public class PullServiceTest { @Mock private ApplicationConfiguration config; - private boolean isRunning = false; - @Mock private ExecutorService executorService; |