test_class.declarator: pgConnection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PgConnection pgConnection;
test_class.type: PgConnection
test_class.var_name: pgConnection
test_class.declarator: pgReplicationConnection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PGReplicationConnection pgReplicationConnection;
test_class.type: PGReplicationConnection
test_class.var_name: pgReplicationConnection
test_class.declarator: chainedStreamBuilder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ChainedStreamBuilder chainedStreamBuilder;
test_class.type: ChainedStreamBuilder
test_class.var_name: chainedStreamBuilder
test_class.declarator: chainedLogicalStreamBuilder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ChainedLogicalStreamBuilder chainedLogicalStreamBuilder;
test_class.type: ChainedLogicalStreamBuilder
test_class.var_name: chainedLogicalStreamBuilder
test_class.declarator: logicalReplication
test_class.modifier: private
test_class.original_string: private LogicalReplication logicalReplication;
test_class.type: LogicalReplication
test_class.var_name: logicalReplication
test_class.file: shardingsphere-scaling/shardingsphere-scaling-postgresql/src/test/java/org/apache/shardingsphere/scaling/postgresql/wal/LogicalReplicationTest.java
test_class.identifier: LogicalReplicationTest
test_case.body: @Test
      public void assertCreateReplicationStreamSuccess() throws SQLException {
          LogSequenceNumber startPosition = LogSequenceNumber.valueOf(100L);
          when(pgConnection.unwrap(PGConnection.class)).thenReturn(pgConnection);
          when(pgConnection.getReplicationAPI()).thenReturn(pgReplicationConnection);
          when(pgReplicationConnection.replicationStream()).thenReturn(chainedStreamBuilder);
          when(chainedStreamBuilder.logical()).thenReturn(chainedLogicalStreamBuilder);
          when(chainedLogicalStreamBuilder.withStartPosition(startPosition)).thenReturn(chainedLogicalStreamBuilder);
          when(chainedLogicalStreamBuilder.withSlotName("")).thenReturn(chainedLogicalStreamBuilder);
          when(chainedLogicalStreamBuilder.withSlotOption(anyString(), eq(true))).thenReturn(chainedLogicalStreamBuilder, chainedLogicalStreamBuilder);
          logicalReplication.createReplicationStream(pgConnection, "", startPosition);
          verify(chainedLogicalStreamBuilder).start();
      }
test_case.class_method_signature: LogicalReplicationTest.assertCreateReplicationStreamSuccess()
test_case.full_signature: @Test public void assertCreateReplicationStreamSuccess()
test_case.identifier: assertCreateReplicationStreamSuccess
test_case.invocations: valueOf thenReturn when unwrap thenReturn when getReplicationAPI thenReturn when replicationStream thenReturn when logical thenReturn when withStartPosition thenReturn when withSlotName thenReturn when withSlotOption anyString eq createReplicationStream start verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertCreateReplicationStreamSuccess()
focal_class.file: shardingsphere-scaling/shardingsphere-scaling-postgresql/src/main/java/org/apache/shardingsphere/scaling/postgresql/wal/LogicalReplication.java
focal_class.identifier: LogicalReplication
focal_class.class_method_signature: LogicalReplication.createPgConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.full_signature: public Connection createPgConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.identifier: createPgConnection
focal_class.modifiers: public
focal_class.parameters: (final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.return: Connection
focal_class.signature: Connection createPgConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.class_method_signature: LogicalReplication.createConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.full_signature: private Connection createConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.identifier: createConnection
focal_class.modifiers: private
focal_class.parameters: (final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.return: Connection
focal_class.signature: Connection createConnection(final JDBCScalingDataSourceConfiguration jdbcDataSourceConfig)
focal_class.class_method_signature: LogicalReplication.createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_class.full_signature: public PGReplicationStream createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_class.identifier: createReplicationStream
focal_class.modifiers: public
focal_class.parameters: (final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_class.return: PGReplicationStream
focal_class.signature: PGReplicationStream createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_method.body: public PGReplicationStream createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition) throws SQLException {
          return pgConnection.unwrap(PGConnection.class).getReplicationAPI()
                  .replicationStream()
                  .logical()
                  .withStartPosition(startPosition)
                  .withSlotName(slotName)
                  .withSlotOption("include-xids", true)
                  .withSlotOption("skip-empty-xacts", true)
                  .start();
      }
focal_method.class_method_signature: LogicalReplication.createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_method.full_signature: public PGReplicationStream createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_method.identifier: createReplicationStream
focal_method.invocations: start withSlotOption withSlotOption withSlotName withStartPosition logical replicationStream getReplicationAPI unwrap
focal_method.modifiers: public
focal_method.parameters: (final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)
focal_method.return: PGReplicationStream
focal_method.signature: PGReplicationStream createReplicationStream(final Connection pgConnection, final String slotName, final LogSequenceNumber startPosition)