import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.onap.dmaap.dbcapi.testframework.ReflectionHarness;
+
+import java.util.ArrayList;
public class MirrorMakerTest {
ReflectionHarness rh = new ReflectionHarness();
- String s, t;
@Before
public void setUp() throws Exception {
- s = "source";
- t = "target";
}
@After
rh.reflect( "org.onap.dmaap.dbcapi.model.MirrorMaker", "get", null );
}
-
@Test
public void test2() {
- MirrorMaker m = new MirrorMaker( s, t );
-
- assertTrue( s.equals( m.getSourceCluster() ));
- assertTrue( t.equals( m.getTargetCluster() ));
+ String v = "Validate";
+ rh.reflect( "org.onap.dmaap.dbcapi.model.MirrorMaker", "set", v );
}
@Test
public void test3() {
+ String f = "org.onap.interestingTopic";
+ String c1 = "cluster1.onap.org";
+ String c2 = "cluster2.onap.org";
+ MirrorMaker t = new MirrorMaker( c1, c2 );
+ String m = t.getMmName();
+
+ MirrorMaker.genKey( c1, c2 );
+
+ assertTrue( c1.equals( t.getSourceCluster() ));
+ assertTrue( c2.equals( t.getTargetCluster() ));
+ }
+
+
+ @Test
+ public void test4() {
+ String f = "org.onap.interestingTopic";
+ String c1 = "cluster1.onap.org";
+ String c2 = "cluster2.onap.org";
+ String p1 = "9092";
+ String p2 = "2081";
+ MirrorMaker t = new MirrorMaker( c1, c2 );
+ String m = t.getMmName();
+
+
+ ArrayList<String> topics = new ArrayList<String>();
+ topics.add( f );
+ t.setTopics( topics );
+ t.addTopic( "org.onap.topic2" );
+
+ int i = t.getTopicCount();
+
+ String s = t.getWhitelistUpdateJSON();
+
+ s = t.createMirrorMaker(p1, p2);
- String v = "Validate";
- rh.reflect( "org.onap.dmaap.dbcapi.model.MirrorMaker", "set", v );
}
}