package com.ijdbc.oracle.scenarios;

import com.ijdbc.common.JDBCInstrumentation;
import com.ijdbc.oracle.OracleInstrumentationUtil;

import com.tngtech.jgiven.Stage;

import java.sql.Connection;
import java.sql.SQLException;

import oracle.jdbc.OracleConnection;

import org.mockito.Mockito;

/**
 * @author mdelapenya
 */
public class GivenAConnection extends Stage<GivenAConnection> {

	public Connection getConnection() {
		return connection;
	}

	public GivenAConnection theConnection()
		throws SQLException {

		JDBCInstrumentation jdbcInstrumentation = new JDBCInstrumentation(
			"actionName", "clientInfo", "moduleName");

		connection = Mockito.mock(OracleConnection.class);

		OracleInstrumentationUtil.instrument(connection, jdbcInstrumentation);

		return self();
	}

	private Connection connection;

}
@@ -34,53 +34,8 @@
 s;%0A%0A
-import com.ijdbc.common.JDBCInstrumentation;%0A
 impo
@@ -469,124 +469,8 @@
  %7B%0A%0A
-%09%09JDBCInstrumentation jdbcInstrumentation = new JDBCInstrumentation(%0A%09%09%09%22actionName%22, %22clientInfo%22, %22moduleName%22);%0A%0A
 %09%09co
@@ -558,16 +558,20 @@
 trument(
+%0A%09%09%09
 connecti
@@ -578,27 +578,48 @@
 on, 
-jdbcInstrumentation
+%22actionName%22, %22clientInfo%22, %22moduleName%22
 );%0A%0A

Use method with parameters