Skip to content

Commit

Permalink
chore: Fix unit tests after mysql update (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel authored May 23, 2024
1 parent 2e388c9 commit 816c899
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/java/liquibase/ext/percona/NoOpMySqlConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.mysql.cj.conf.HostInfo;
import com.mysql.cj.conf.PropertyKey;
import com.mysql.cj.jdbc.ConnectionImpl;
import com.mysql.cj.jdbc.JdbcPropertySet;
import com.mysql.cj.jdbc.JdbcPropertySetImpl;
import com.mysql.cj.protocol.NetworkResources;

public class NoOpMySqlConnection extends ConnectionImpl {
Expand All @@ -33,8 +35,13 @@ public class NoOpMySqlConnection extends ConnectionImpl {

public NoOpMySqlConnection(String hostToConnectTo, int portToConnectTo, Properties info,
String databaseToConnectTo, String url) throws SQLException {
super(convert(hostToConnectTo, portToConnectTo, info, databaseToConnectTo, url));
super();
this.info = info;

HostInfo hostInfo = convert(hostToConnectTo, portToConnectTo, info, databaseToConnectTo, url);
this.props = hostInfo.exposeAsProperties();
this.propertySet = new JdbcPropertySetImpl();
this.propertySet.initializeProperties(this.props);
}

private static HostInfo convert(String hostToConnectTo, int portToConnectTo, Properties info,
Expand Down

0 comments on commit 816c899

Please sign in to comment.