Remove duplicate table creation 67/95967/2
authorsubhash.kumar.singh <subhash.kumar.singh@huawei.com>
Thu, 19 Sep 2019 07:05:39 +0000 (12:35 +0530)
committersubhash.kumar.singh <subhash.kumar.singh@huawei.com>
Thu, 19 Sep 2019 08:50:42 +0000 (14:20 +0530)
Remove code to create table as it is already done by the MusicMixin
constructor.

Added java8 syntax enhancement.

Change-Id: Ic04987d701e969466f40fbe255576b85206032f9
Signed-off-by: subhash.kumar.singh <subhash.kumar.singh@huawei.com>
Issue-ID: MUSIC-412

mdbc-server/src/test/java/org/onap/music/mdbc/MdbcTestUtils.java
mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java

index f7dd8ee..26256eb 100644 (file)
@@ -249,7 +249,6 @@ public class MdbcTestUtils {
 
     public static MusicMixin getMusicMixin() throws MDBCServiceException {
         initNamespaces();
-        initTables();
         MusicMixin mixin=null;
         try {
             Properties properties = new Properties();
@@ -268,13 +267,4 @@ public class MdbcTestUtils {
         MusicMixin.createKeyspace("music_internal",1);
         MusicMixin.createKeyspace(keyspace,1);
     }
-
-    public static void initTables() throws MDBCServiceException{
-        MusicMixin.createMusicRangeInformationTable(keyspace, mriTableName);
-        MusicMixin.createMusicTxDigest(mtdTableName,keyspace, -1);
-        MusicMixin.createMusicEventualTxDigest(eventualMtxdTableName,keyspace, -1);
-        MusicMixin.createMusicNodeInfoTable(nodeInfoTableName,keyspace,-1);
-        MusicMixin.createMusicRangeDependencyTable(keyspace,rangeDependencyTableName);
-    }
-
 }
index ef26cb6..9800126 100644 (file)
@@ -107,7 +107,7 @@ public class MusicMixinTest {
     public void initTest() throws MDBCServiceException {
         session = MdbcTestUtils.getSession();
         session.execute("DROP KEYSPACE IF EXISTS "+ MdbcTestUtils.getKeyspace());
-        mixin=MdbcTestUtils.getMusicMixin();
+        mixin = MdbcTestUtils.getMusicMixin();
     }
 
     //@Test(timeout=10000)
@@ -253,21 +253,7 @@ public class MusicMixinTest {
         mixin.addEventualTxDigest(digestId, compressed);
         
         LinkedHashMap<UUID, StagingTable> digest =  mixin.getEveTxDigest("n1");
-        
-        Consumer<Map.Entry<UUID,StagingTable>> consumer = new Consumer<Map.Entry<UUID,StagingTable>>() {
-
-            @Override
-            public void accept(Entry<UUID, StagingTable> mapEntry) {
-                assertNotNull(mapEntry.getValue());
-            }
-            
-        };
-       
-        digest.entrySet().forEach(consumer);
-        
-        
-        
-        
+        digest.entrySet().forEach(e -> assertNotNull(e.getValue()));
     }
 
     protected ByteBuffer mockCompressedProtoByteBuff() throws MDBCServiceException, InvalidProtocolBufferException {