Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes MySQLDataSourcePreparerTest #15203

Merged
merged 4 commits into from Jan 30, 2022
Merged

Conversation

ksankeerth
Copy link
Contributor

@ksankeerth ksankeerth commented Jan 30, 2022

Fixes #14246.

Fixed :
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java

Added internal dependencies to the subproject:

shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/pom.xml

Updated Mockito version to 3.4.2 :

shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/pom.xml

For the above test cases, we have to mock PipelineDataSourceConfigurationFactory. Since PipelineDataSourceConfigurationFactory’s method is static, we have to use mockStatic. In Mockito 3.4.0, the same test cases will throw NotAMockException. It seems like a bug in Mockito 3.4.0 and they were fixed in 3.4.2.

In local testing, any tests didn’t fail after changing the Mockito version from 3.4.0 to 3.4.2

Mockito PR
Mockito Issue

In Mocktio 3.4.0, static mocks causes NotAMockException. They are fixed in 3.4.2.
[1] : mockito/mockito#1968
[2]: mockito/mockito#1967
…o dev-14246

� Conflicts:
�	shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java
@ksankeerth ksankeerth changed the title Dev 14246 Fixes MySQLDataSourcePreparerTest Jan 30, 2022
@terrymanu
Copy link
Member

Great Job

@terrymanu terrymanu added this to the 5.1.1 milestone Jan 30, 2022
@terrymanu terrymanu merged commit 0fc123f into apache:master Jan 30, 2022
@ksankeerth ksankeerth deleted the dev-14246 branch January 30, 2022 04:42
@menghaoranss menghaoranss modified the milestones: 5.1.1, 5.1.0 Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix test case MySQLDataSourcePreparerTest
3 participants