Skip to content

Commit

Permalink
Fix ArgumentCaptor can't capture varargs (#1320)
Browse files Browse the repository at this point in the history
* Fix ArgumentCaptor can't capture varargs

Signed-off-by: Peng Huo <penghuo@gmail.com>

* bump bwc version to 2.6.0

Signed-off-by: Peng Huo <penghuo@gmail.com>

---------

Signed-off-by: Peng Huo <penghuo@gmail.com>
  • Loading branch information
penghuo authored Feb 3, 2023
1 parent cfe6802 commit 513428b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ task comparisonTest(type: RestIntegTestTask) {
systemProperty "queries", System.getProperty("queries")
}

String baseVersion = "2.5.0"
String baseVersion = "2.6.0"
String bwcVersion = baseVersion + ".0";
String baseName = "sqlBwcCluster"
String bwcFilePath = "src/test/resources/bwc/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import lombok.SneakyThrows;
Expand Down Expand Up @@ -111,10 +112,10 @@ void loadConnectors(Settings settings) {
}

void verifyAddDataSourceWithMetadata(List<DataSourceMetadata> metadataList) {
ArgumentCaptor<DataSourceMetadata> metadataCaptor =
ArgumentCaptor.forClass(DataSourceMetadata.class);
ArgumentCaptor<DataSourceMetadata[]> metadataCaptor =
ArgumentCaptor.forClass(DataSourceMetadata[].class);
verify(dataSourceService, times(1)).addDataSource(metadataCaptor.capture());
List<DataSourceMetadata> actualValues = metadataCaptor.getAllValues();
List<DataSourceMetadata> actualValues = Arrays.asList(metadataCaptor.getValue());
assertEquals(metadataList.size(), actualValues.size());
assertEquals(metadataList, actualValues);
}
Expand Down

0 comments on commit 513428b

Please sign in to comment.