File tree 1 file changed +7
-1
lines changed
connect/mirror/src/test/java/org/apache/kafka/connect/mirror
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,16 @@ public void testReplicatesHeartbeatsByDefault() {
104
104
105
105
@ Test
106
106
public void testReplicatesHeartbeatsDespiteFilter () {
107
+ DefaultReplicationPolicy defaultReplicationPolicy = new DefaultReplicationPolicy ();
107
108
MirrorSourceConnector connector = new MirrorSourceConnector (new SourceAndTarget ("source" , "target" ),
108
- new DefaultReplicationPolicy () , x -> false , new DefaultConfigPropertyFilter ());
109
+ defaultReplicationPolicy , x -> false , new DefaultConfigPropertyFilter ());
109
110
assertTrue (connector .shouldReplicateTopic ("heartbeats" ), "should replicate heartbeats" );
110
111
assertTrue (connector .shouldReplicateTopic ("us-west.heartbeats" ), "should replicate upstream heartbeats" );
112
+
113
+ Map <String , ?> configs = Collections .singletonMap (DefaultReplicationPolicy .SEPARATOR_CONFIG , "_" );
114
+ defaultReplicationPolicy .configure (configs );
115
+ assertTrue (connector .shouldReplicateTopic ("heartbeats" ), "should replicate heartbeats" );
116
+ assertFalse (connector .shouldReplicateTopic ("us-west.heartbeats" ), "should not consider this topic as a heartbeats topic" );
111
117
}
112
118
113
119
@ Test
You can’t perform that action at this time.
0 commit comments