davyam commented on a change in pull request #5710:
URL: https://github.com/apache/nifi/pull/5710#discussion_r795087646



##########
File path: 
nifi-nar-bundles/nifi-cdc/nifi-cdc-postgresql-bundle/nifi-cdc-postgresql-processors/src/test/java/org/apache/nifi/cdc/postgresql/event/MockReader.java
##########
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.cdc.postgresql.event;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.sql.SQLException;
+import java.text.ParseException;
+import java.util.HashMap;
+
+import org.postgresql.replication.LogSequenceNumber;
+
+/**
+ * Mock Reader class.
+ */
+public class MockReader extends Reader {
+  private boolean includeBeginCommit;
+  private boolean includeAllMetadata;
+  private MockPGReplicationStream replicationStream;
+
+  public MockReader(Long lsn, boolean includeBeginCommit, boolean 
includeAllMetadata) throws SQLException {
+    super(lsn, includeBeginCommit, includeAllMetadata);
+
+    try {
+      // Creating a mock replication stream
+      LogSequenceNumber startLSN = lsn == null ? 
LogSequenceNumber.valueOf(100L) : LogSequenceNumber.valueOf(lsn);
+      this.replicationStream = new MockPGReplicationStream(startLSN);
+
+    } catch (SQLException e) {
+      throw new SQLException("Failed to create replication stream. " + e, e);
+    }

Review comment:
       Yeah, I agree, this must be included in the NiFi Checkstyle! Recently I 
changed this configuration (tab instead four-spaces) for another project. I'll 
undo and update the code. No problem!




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to