|
1 | 1 | /*
|
2 |
| - * Copyright 2009-2023 the original author or authors. |
| 2 | + * Copyright 2009-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -155,4 +155,33 @@ void specifyQueryTimeoutAndTransactionTimeoutWithSameValue() throws SQLException
|
155 | 155 | verify(statement).setQueryTimeout(10);
|
156 | 156 | }
|
157 | 157 |
|
| 158 | + @Test |
| 159 | + void specifyDefaultFetchSizeOnly() throws SQLException { |
| 160 | + doReturn(50).when(configuration).getDefaultFetchSize(); |
| 161 | + BaseStatementHandler handler = new SimpleStatementHandler(null, mappedStatementBuilder.build(), null, null, null, |
| 162 | + null); |
| 163 | + handler.setFetchSize(statement); |
| 164 | + |
| 165 | + verify(statement).setFetchSize(50); |
| 166 | + } |
| 167 | + |
| 168 | + @Test |
| 169 | + void specifyMappedStatementFetchSizeOnly() throws SQLException { |
| 170 | + BaseStatementHandler handler = new SimpleStatementHandler(null, mappedStatementBuilder.fetchSize(10).build(), null, |
| 171 | + null, null, null); |
| 172 | + handler.setFetchSize(statement); |
| 173 | + |
| 174 | + verify(statement).setFetchSize(10); |
| 175 | + } |
| 176 | + |
| 177 | + @Test |
| 178 | + void specifyDefaultAndMappedStatementFetchSize() throws SQLException { |
| 179 | + doReturn(50).when(configuration).getDefaultFetchSize(); |
| 180 | + BaseStatementHandler handler = new SimpleStatementHandler(null, mappedStatementBuilder.fetchSize(10).build(), null, |
| 181 | + null, null, null); |
| 182 | + handler.setFetchSize(statement); |
| 183 | + |
| 184 | + verify(statement).setFetchSize(10); |
| 185 | + } |
| 186 | + |
158 | 187 | }
|
0 commit comments