Skip to content

Commit

Permalink
Added error handling and default logic for Flink version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
gjacoby126 committed Jan 9, 2024
1 parent 7428ec2 commit 4384e94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public void testVersion() {

@Test
public void testDefaultVersion() {
// It's difficult to reproduce a reflection error in a unit test, so we just inject a mocked fault to test
// the default logic
// It's difficult to reproduce a reflection error in a unit test, so we just inject a mocked
// fault to test the default logic
FlinkVersionDetector detectorWithReflectionError = Mockito.spy(FlinkVersionDetector.class);
Mockito.when(detectorWithReflectionError.getVersionFromJar()).thenThrow(RuntimeException.class);
FlinkPackage.setVersionDetector(detectorWithReflectionError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public void testVersion() {
@Test
public void testDefaultVersion() {
// It's difficult to reproduce a reflection error in a unit test, so we just inject a mocked
// fault to test
// the default logic
// fault to test the default logic
FlinkVersionDetector detectorWithReflectionError = Mockito.spy(FlinkVersionDetector.class);
Mockito.when(detectorWithReflectionError.getVersionFromJar()).thenThrow(RuntimeException.class);
FlinkPackage.setVersionDetector(detectorWithReflectionError);
Expand Down

0 comments on commit 4384e94

Please sign in to comment.