File tree Expand file tree Collapse file tree
springboot-starter-data-authorization/src/test/java/com/codingapi/springboot/authorization/jdbc/proxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 <snakeyaml .version>2.2</snakeyaml .version>
5050 <apache-groovy .version>4.0.24</apache-groovy .version>
5151 <h2 .version>1.4.200</h2 .version>
52- <jsqlparser .version>5.0 </jsqlparser .version>
52+ <jsqlparser .version>4.9 </jsqlparser .version>
5353 </properties >
5454
5555 <dependencies >
Original file line number Diff line number Diff line change @@ -615,18 +615,11 @@ void testAttributeDelegates() throws SQLException {
615615 }
616616
617617 @ Test
618- void testEnquoteAndWrapperDelegates () throws SQLException {
619- when (callableStatement .enquoteLiteral ("v" )).thenReturn ("'v'" );
620- when (callableStatement .enquoteIdentifier ("id" , true )).thenReturn ("\" id\" " );
621- when (callableStatement .isSimpleIdentifier ("id" )).thenReturn (true );
622- when (callableStatement .enquoteNCharLiteral ("v" )).thenReturn ("N'v'" );
618+ void testWrapperDelegates () throws SQLException {
619+ // enquoteLiteral/enquoteIdentifier/isSimpleIdentifier/enquoteNCharLiteral 为 JDK 9+ 的 Statement API,8.x 版本线不覆盖
623620 when (callableStatement .unwrap (String .class )).thenReturn ("unwrapped" );
624621 when (callableStatement .isWrapperFor (String .class )).thenReturn (true );
625622
626- assertEquals ("'v'" , proxy .enquoteLiteral ("v" ));
627- assertEquals ("\" id\" " , proxy .enquoteIdentifier ("id" , true ));
628- assertTrue (proxy .isSimpleIdentifier ("id" ));
629- assertEquals ("N'v'" , proxy .enquoteNCharLiteral ("v" ));
630623 assertEquals ("unwrapped" , proxy .unwrap (String .class ));
631624 assertTrue (proxy .isWrapperFor (String .class ));
632625 }
Original file line number Diff line number Diff line change @@ -363,18 +363,11 @@ void testAttributeDelegates() throws SQLException {
363363 }
364364
365365 @ Test
366- void testEnquoteAndWrapperDelegates () throws SQLException {
367- when (preparedStatement .enquoteLiteral ("v" )).thenReturn ("'v'" );
368- when (preparedStatement .enquoteIdentifier ("id" , true )).thenReturn ("\" id\" " );
369- when (preparedStatement .isSimpleIdentifier ("id" )).thenReturn (true );
370- when (preparedStatement .enquoteNCharLiteral ("v" )).thenReturn ("N'v'" );
366+ void testWrapperDelegates () throws SQLException {
367+ // enquoteLiteral/enquoteIdentifier/isSimpleIdentifier/enquoteNCharLiteral 为 JDK 9+ 的 Statement API,8.x 版本线不覆盖
371368 when (preparedStatement .unwrap (String .class )).thenReturn ("unwrapped" );
372369 when (preparedStatement .isWrapperFor (String .class )).thenReturn (true );
373370
374- assertEquals ("'v'" , proxy .enquoteLiteral ("v" ));
375- assertEquals ("\" id\" " , proxy .enquoteIdentifier ("id" , true ));
376- assertTrue (proxy .isSimpleIdentifier ("id" ));
377- assertEquals ("N'v'" , proxy .enquoteNCharLiteral ("v" ));
378371 assertEquals ("unwrapped" , proxy .unwrap (String .class ));
379372 assertTrue (proxy .isWrapperFor (String .class ));
380373 }
Original file line number Diff line number Diff line change @@ -228,18 +228,11 @@ void testAttributeDelegates() throws SQLException {
228228 }
229229
230230 @ Test
231- void testEnquoteAndWrapperDelegates () throws SQLException {
232- when (statement .enquoteLiteral ("v" )).thenReturn ("'v'" );
233- when (statement .enquoteIdentifier ("id" , true )).thenReturn ("\" id\" " );
234- when (statement .isSimpleIdentifier ("id" )).thenReturn (true );
235- when (statement .enquoteNCharLiteral ("v" )).thenReturn ("N'v'" );
231+ void testWrapperDelegates () throws SQLException {
232+ // enquoteLiteral/enquoteIdentifier/isSimpleIdentifier/enquoteNCharLiteral 为 JDK 9+ 的 Statement API,8.x 版本线不覆盖
236233 when (statement .unwrap (String .class )).thenReturn ("unwrapped" );
237234 when (statement .isWrapperFor (String .class )).thenReturn (true );
238235
239- assertEquals ("'v'" , proxy .enquoteLiteral ("v" ));
240- assertEquals ("\" id\" " , proxy .enquoteIdentifier ("id" , true ));
241- assertTrue (proxy .isSimpleIdentifier ("id" ));
242- assertEquals ("N'v'" , proxy .enquoteNCharLiteral ("v" ));
243236 assertEquals ("unwrapped" , proxy .unwrap (String .class ));
244237 assertTrue (proxy .isWrapperFor (String .class ));
245238 }
You can’t perform that action at this time.
0 commit comments