From 524904eaedd84201ae008c9098aebcaa69181d14 Mon Sep 17 00:00:00 2001 From: "subhash.kumar.singh" Date: Thu, 19 Sep 2019 12:35:39 +0530 Subject: Remove duplicate table creation 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 Issue-ID: MUSIC-412 --- .../test/java/org/onap/music/mdbc/MdbcTestUtils.java | 10 ---------- .../org/onap/music/mdbc/mixins/MusicMixinTest.java | 18 ++---------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcTestUtils.java b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcTestUtils.java index f7dd8ee..26256eb 100644 --- a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcTestUtils.java +++ b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcTestUtils.java @@ -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); - } - } diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java index ef26cb6..9800126 100644 --- a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java +++ b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java @@ -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 digest = mixin.getEveTxDigest("n1"); - - Consumer> consumer = new Consumer>() { - - @Override - public void accept(Entry mapEntry) { - assertNotNull(mapEntry.getValue()); - } - - }; - - digest.entrySet().forEach(consumer); - - - - + digest.entrySet().forEach(e -> assertNotNull(e.getValue())); } protected ByteBuffer mockCompressedProtoByteBuff() throws MDBCServiceException, InvalidProtocolBufferException { -- cgit 1.2.3-korg