Skip to content

Commit 663846d

Browse files
committed
Additional test updates for SSPAU=false
1 parent 105b7a0 commit 663846d

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ protected static void populateCharSetObjectWithJDBCTypes(String[] charValues) th
10821082
String sql = "insert into " + CHAR_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
10831083
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
10841084

1085-
try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(AETestConnectionString, AEInfo);
1085+
try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
10861086
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
10871087
stmtColEncSetting)) {
10881088

@@ -1144,7 +1144,7 @@ protected static void populateCharNullCase() throws SQLException {
11441144
String sql = "insert into " + CHAR_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
11451145
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
11461146

1147-
try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(AETestConnectionString, AEInfo);
1147+
try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
11481148
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
11491149
stmtColEncSetting)) {
11501150

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/CallableStatementTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private void createMultiInsertionSelection() throws SQLException {
540540
+ TestUtils.escapeSingleQuotes(multiStatementsProcedure)
541541
+ "') and OBJECTPROPERTY(id, N'IsProcedure') = 1)" + " DROP PROCEDURE " + multiStatementsProcedure;
542542

543-
try (Connection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
543+
try (Connection con = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
544544
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
545545
stmt.execute(sql);
546546

@@ -556,7 +556,7 @@ private void createMultiInsertionSelection() throws SQLException {
556556
private void MultiInsertionSelection() throws SQLException {
557557

558558
String sql = "{call " + multiStatementsProcedure + " (?,?,?,?,?,?)}";
559-
try (Connection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
559+
try (Connection con = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
560560
SQLServerCallableStatement callableStatement = (SQLServerCallableStatement) TestUtils
561561
.getCallableStmt(con, sql, stmtColEncSetting)) {
562562

@@ -673,7 +673,7 @@ private void createInputProcedure2() throws SQLException {
673673
+ TestUtils.escapeSingleQuotes(inputProcedure2) + "') and OBJECTPROPERTY(id, N'IsProcedure') = 1)"
674674
+ " DROP PROCEDURE " + inputProcedure2;
675675

676-
try (Connection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
676+
try (Connection con = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
677677
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
678678
stmt.execute(sql);
679679

@@ -690,7 +690,7 @@ private void createInputProcedure2() throws SQLException {
690690

691691
private void testInputProcedure2(String sql) throws SQLException {
692692

693-
try (Connection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
693+
try (Connection con = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
694694
SQLServerCallableStatement callableStatement = (SQLServerCallableStatement) TestUtils
695695
.getCallableStmt(con, sql, stmtColEncSetting)) {
696696

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/EnclaveTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void testVerifyBadJksSignature(String serverName, String url, String prot
210210
String badTable = TestUtils.escapeSingleQuotes(
211211
AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("testVerifyBadJksSignature")));
212212

213-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
213+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
214214
Statement s = c.createStatement()) {
215215
createCMK(AETestConnectionString, badCmk, Constants.JAVA_KEY_STORE_NAME, javaKeyAliases, "0x666");
216216
createCEK(AETestConnectionString, badCmk, badCek, jksProvider);
@@ -256,7 +256,7 @@ public void testVerifyBadAkvSignature(String serverName, String url, String prot
256256
String badTable = TestUtils.escapeSingleQuotes(
257257
AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("testVerifyBadAkvSignature")));
258258

259-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
259+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
260260
Statement s = c.createStatement()) {
261261
createCMK(AETestConnectionString, badCmk, Constants.AZURE_KEY_VAULT_NAME, keyIDs[0], "0x666");
262262
createCEK(AETestConnectionString, badCmk, badCek, akvProvider);
@@ -301,7 +301,7 @@ public void testVerifyBadWinSignature(String serverName, String url, String prot
301301
String badTable = TestUtils.escapeSingleQuotes(
302302
AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("testVerifyBadWinSignature")));
303303

304-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
304+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
305305
Statement s = c.createStatement()) {
306306
// create CMK with a bad signature
307307
createCMK(AETestConnectionString, badCmk, Constants.WINDOWS_KEY_STORE_NAME, windowsKeyPath, "0x666");
@@ -397,7 +397,7 @@ public void testAEFMTOnly(String serverName, String url, String protocol) throws
397397
@MethodSource("enclaveParams")
398398
public void testAlter(String serverName, String url, String protocol) throws Exception {
399399
setAEConnectionString(serverName, url, protocol);
400-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
400+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
401401
Statement s = c.createStatement()) {
402402
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
403403
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + CHAR_TABLE_AE + " VALUES (?,?,?)");
@@ -445,7 +445,7 @@ public void testNumericRichQuery(String serverName, String url, String protocol)
445445
@MethodSource("enclaveParams")
446446
public void testStringRichQuery(String serverName, String url, String protocol) throws Exception {
447447
setAEConnectionString(serverName, url, protocol);
448-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
448+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
449449
Statement s = c.createStatement()) {
450450
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
451451

@@ -473,7 +473,7 @@ public void testStringRichQuery(String serverName, String url, String protocol)
473473
@MethodSource("enclaveParams")
474474
public void testAlterNoEncrypt(String serverName, String url, String protocol) throws Exception {
475475
setAEConnectionString(serverName, url, protocol);
476-
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
476+
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
477477
Statement s = c.createStatement()) {
478478
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
479479
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + CHAR_TABLE_AE + " VALUES (?,?,?)");

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/MultiUserAKVTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ public void testStatementCustomKeyStoreProviderDuringAeQuery() throws Exception
526526
private void insertData(String tableName, int customId, String customName) {
527527
String sqlQuery = "INSERT INTO " + tableName + " VALUES ( ?, ? )";
528528

529-
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
529+
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;", AEInfo);
530530
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sqlQuery,
531531
SQLServerStatementColumnEncryptionSetting.ENABLED)) {
532532
pstmt.setInt(1, customId);

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/RegressionAlwaysEncryptedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void alwaysEncrypted1(String serverName, String url, String protocol) thr
7575
public void alwaysEncrypted2(String serverName, String url, String protocol) throws Exception {
7676
setAEConnectionString(serverName, url, protocol);
7777
try (Connection connection = PrepUtil
78-
.getConnection(AETestConnectionString + ";columnEncryptionSetting=enabled;", AEInfo);
78+
.getConnection(AETestConnectionString + ";sendStringParametersAsUnicode=false;columnEncryptionSetting=enabled;", AEInfo);
7979
Statement stmt = connection.createStatement()) {
8080
dropTables(stmt);
8181

0 commit comments

Comments
 (0)