11/*
2- * Copyright 2009-2023 the original author or authors.
2+ * Copyright 2009-2024 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2121import static org .mockito .Mockito .when ;
2222
2323import java .io .Reader ;
24- import java .sql .Clob ;
24+ import java .sql .NClob ;
2525
2626import org .junit .jupiter .api .Test ;
2727import org .mockito .ArgumentMatchers ;
@@ -32,60 +32,60 @@ class NClobTypeHandlerTest extends BaseTypeHandlerTest {
3232 private static final TypeHandler <String > TYPE_HANDLER = new NClobTypeHandler ();
3333
3434 @ Mock
35- protected Clob clob ;
35+ protected NClob nclob ;
3636
3737 @ Override
3838 @ Test
3939 public void shouldSetParameter () throws Exception {
4040 TYPE_HANDLER .setParameter (ps , 1 , "Hello" , null );
41- verify (ps ).setCharacterStream (ArgumentMatchers .eq (1 ), ArgumentMatchers .any (Reader .class ), ArgumentMatchers .eq (5 ));
41+ verify (ps ).setNCharacterStream (ArgumentMatchers .eq (1 ), ArgumentMatchers .any (Reader .class ), ArgumentMatchers .eq (5L ));
4242 }
4343
4444 @ Override
4545 @ Test
4646 public void shouldGetResultFromResultSetByName () throws Exception {
47- when (rs .getClob ("column" )).thenReturn (clob );
48- when (clob .length ()).thenReturn (3L );
49- when (clob .getSubString (1 , 3 )).thenReturn ("Hello" );
47+ when (rs .getNClob ("column" )).thenReturn (nclob );
48+ when (nclob .length ()).thenReturn (3L );
49+ when (nclob .getSubString (1 , 3 )).thenReturn ("Hello" );
5050 assertEquals ("Hello" , TYPE_HANDLER .getResult (rs , "column" ));
5151 }
5252
5353 @ Override
5454 @ Test
5555 public void shouldGetResultNullFromResultSetByName () throws Exception {
56- when (rs .getClob ("column" )).thenReturn (null );
56+ when (rs .getNClob ("column" )).thenReturn (null );
5757 assertNull (TYPE_HANDLER .getResult (rs , "column" ));
5858 }
5959
6060 @ Override
6161 @ Test
6262 public void shouldGetResultFromResultSetByPosition () throws Exception {
63- when (rs .getClob (1 )).thenReturn (clob );
64- when (clob .length ()).thenReturn (3L );
65- when (clob .getSubString (1 , 3 )).thenReturn ("Hello" );
63+ when (rs .getNClob (1 )).thenReturn (nclob );
64+ when (nclob .length ()).thenReturn (3L );
65+ when (nclob .getSubString (1 , 3 )).thenReturn ("Hello" );
6666 assertEquals ("Hello" , TYPE_HANDLER .getResult (rs , 1 ));
6767 }
6868
6969 @ Override
7070 @ Test
7171 public void shouldGetResultNullFromResultSetByPosition () throws Exception {
72- when (rs .getClob (1 )).thenReturn (null );
72+ when (rs .getNClob (1 )).thenReturn (null );
7373 assertNull (TYPE_HANDLER .getResult (rs , 1 ));
7474 }
7575
7676 @ Override
7777 @ Test
7878 public void shouldGetResultFromCallableStatement () throws Exception {
79- when (cs .getClob (1 )).thenReturn (clob );
80- when (clob .length ()).thenReturn (3L );
81- when (clob .getSubString (1 , 3 )).thenReturn ("Hello" );
79+ when (cs .getNClob (1 )).thenReturn (nclob );
80+ when (nclob .length ()).thenReturn (3L );
81+ when (nclob .getSubString (1 , 3 )).thenReturn ("Hello" );
8282 assertEquals ("Hello" , TYPE_HANDLER .getResult (cs , 1 ));
8383 }
8484
8585 @ Override
8686 @ Test
8787 public void shouldGetResultNullFromCallableStatement () throws Exception {
88- when (cs .getClob (1 )).thenReturn (null );
88+ when (cs .getNClob (1 )).thenReturn (null );
8989 assertNull (TYPE_HANDLER .getResult (cs , 1 ));
9090 }
9191
0 commit comments