healchow commented on a change in pull request #3081:
URL: https://github.com/apache/incubator-inlong/pull/3081#discussion_r825251339
##########
File path:
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestPulsarSink.java
##########
@@ -47,33 +56,42 @@
private int batchSize = 1;
private PulsarSink sink;
- private Channel channel;
+ private MemoryChannel channel;
// private ThirdPartyClusterConfig pulsarConfig = new
ThirdPartyClusterConfig();
// private Map<String, String> url2token;
@Mock
private static ConfigManager configManager;
- public void setUp() {
+ public void setUp() throws Exception {
+ // mock
+ MockUtils.mockMetricRegister();
+ PowerMockito.mockStatic(ReloadConfigWorker.class);
+ ReloadConfigWorker worker =
PowerMockito.mock(ReloadConfigWorker.class);
+// PowerMockito.doNothing().when(worker, "setDaemon", true);
+ PowerMockito.doNothing().when(worker, "start");
+ PowerMockito.when(ReloadConfigWorker.class, "create",
any()).thenReturn(worker);
+
ConfigManager.getInstance().getCommonProperties().put(CONFIG_LOG_REPORT_ENABLE,
"false");
+ // prepare
sink = new PulsarSink();
channel = new MemoryChannel();
// url2token =
ConfigManager.getInstance().getThirdPartyClusterUrl2Token();
Context context = new Context();
context.put("type", "org.apache.inlong.dataproxy.sink.PulsarSink");
sink.setChannel(channel);
- Configurables.configure(sink, context);
- Configurables.configure(channel, context);
+// Configurables.configure(sink, context);
Review comment:
Remove those unused codes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]