Skip to content

Commit 4290ac9

Browse files
Update VolumeOperationProcessorTest mocks to use executeWithRetry
VolumeOperationProcessor uses executeWithRetry(), not execute(). Update test mocks to match actual usage: - Replace when(databricksHttpClient.execute(any())) - With when(databricksHttpClient.executeWithRetry(any(), any())) - Also restore all 4 interface methods in ArrowResultChunkStatusTest (needed because convenience methods still exist in interface) All volume and arrow tests pass. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd9d6cf commit 4290ac9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/test/java/com/databricks/jdbc/api/impl/arrow/ArrowResultChunkStatusTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,21 @@ public CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriReque
9898
return response(content, length);
9999
}
100100

101+
@Override
102+
public CloseableHttpResponse execute(
103+
org.apache.http.client.methods.HttpUriRequest request, boolean supportGzipEncoding)
104+
throws DatabricksHttpException {
105+
return response(content, length);
106+
}
107+
108+
@Override
109+
public CloseableHttpResponse executeWithRetry(
110+
org.apache.http.client.methods.HttpUriRequest request,
111+
com.databricks.jdbc.common.RequestType requestType)
112+
throws DatabricksHttpException {
113+
return response(content, length);
114+
}
115+
101116
@Override
102117
public CloseableHttpResponse executeWithRetry(
103118
org.apache.http.client.methods.HttpUriRequest request,

src/test/java/com/databricks/jdbc/api/impl/volume/VolumeOperationProcessorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void testExecuteGetOperationStream_UnsuccessfulHttpResponse() throws Exception {
3636
.getStreamReceiver((entity) -> {})
3737
.build();
3838

39-
when(databricksHttpClient.execute(any())).thenReturn(mockStream);
39+
when(databricksHttpClient.executeWithRetry(any(), any())).thenReturn(mockStream);
4040
when(mockStream.getStatusLine()).thenReturn(mockStatusLine);
4141
when(mockStatusLine.getStatusCode()).thenReturn(400);
4242
volumeOperationProcessor.executeGetOperation();
@@ -56,7 +56,7 @@ void testExecuteGetOperationStream_HttpException() throws Exception {
5656

5757
DatabricksHttpException mockException =
5858
new DatabricksHttpException("Test Exeception", DatabricksDriverErrorCode.INVALID_STATE);
59-
doThrow(mockException).when(databricksHttpClient).execute(any());
59+
doThrow(mockException).when(databricksHttpClient).executeWithRetry(any(), any());
6060

6161
volumeOperationProcessor.executeGetOperation();
6262
assertEquals(volumeOperationProcessor.getStatus(), VolumeOperationStatus.FAILED);
@@ -74,7 +74,7 @@ void testExecutePutOperationStream_HttpException() throws Exception {
7474

7575
DatabricksHttpException mockException =
7676
new DatabricksHttpException("Test Exeception", DatabricksDriverErrorCode.INVALID_STATE);
77-
doThrow(mockException).when(databricksHttpClient).execute(any());
77+
doThrow(mockException).when(databricksHttpClient).executeWithRetry(any(), any());
7878

7979
volumeOperationProcessor.executePutOperation();
8080
assertEquals(volumeOperationProcessor.getStatus(), VolumeOperationStatus.FAILED);

0 commit comments

Comments
 (0)