Skip to content

[PLUGIN-1705] Sink job label support #1998

[PLUGIN-1705] Sink job label support

[PLUGIN-1705] Sink job label support #1998

GitHub Actions / Test Report failed Oct 25, 2023 in 0s

539 tests run, 523 passed, 10 skipped, 6 failed.

Annotations

Check failure on line 109 in src/test/java/io/cdap/plugin/gcp/bigquery/sink/BigQueryOutputFormatTest.java

See this annotation in the file changed.

@github-actions github-actions / Test Report

BigQueryOutputFormatTest.commitJobTestInsertBQInvocations

No method found with name 'handleUpdateUpsertOperation' with parameter types: [ null, java.lang.Boolean, null, null, null, null ] in class io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormat$BigQueryOutputCommitter.
Raw output
org.powermock.reflect.exceptions.MethodNotFoundException: No method found with name 'handleUpdateUpsertOperation' with parameter types: [ null, java.lang.Boolean, null, null, null, null ] in class io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormat$BigQueryOutputCommitter.
	at org.powermock.reflect.internal.WhiteboxImpl.throwExceptionIfMethodWasNotFound(WhiteboxImpl.java:1128)
	at org.powermock.reflect.internal.WhiteboxImpl.findMethodOrThrowException(WhiteboxImpl.java:919)
	at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(WhiteboxImpl.java:813)
	at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(WhiteboxImpl.java:681)
	at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:401)
	at org.powermock.api.mockito.internal.expectation.PowerMockitoStubberImpl.when(PowerMockitoStubberImpl.java:105)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.commitJobTestInsertBQInvocations(BigQueryOutputFormatTest.java:109)

Check failure on line 1 in Test mechanism

See this annotation in the file changed.

@github-actions github-actions / Test Report

Test mechanism

Misplaced or misused argument matcher detected here:

-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:92)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:93)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:94)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:95)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:96)

You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
    when(mock.get(anyInt())).thenReturn(null);
    doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
    verify(mock).someMethod(contains("foo"))

This message may appear after an NullPointerException if the last matcher is returning an object 
like any() but the stubbed method signature expect a primitive argument, in this case,
use primitive alternatives.
    when(mock.get(any())); // bad use, will raise NPE
    when(mock.get(anyInt())); // correct usage use

Also, this error might show up because you use argument matchers with methods that cannot be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
Mocking methods declared on non-public parent classes is not supported.
Raw output
org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
Misplaced or misused argument matcher detected here:

-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:92)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:93)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:94)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:95)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:96)

You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
    when(mock.get(anyInt())).thenReturn(null);
    doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
    verify(mock).someMethod(contains("foo"))

This message may appear after an NullPointerException if the last matcher is returning an object 
like any() but the stubbed method signature expect a primitive argument, in this case,
use primitive alternatives.
    when(mock.get(any())); // bad use, will raise NPE
    when(mock.get(anyInt())); // correct usage use

Also, this error might show up because you use argument matchers with methods that cannot be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
Mocking methods declared on non-public parent classes is not supported.

	at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:87)
	at org.junit.runner.notification.RunNotifier$9.notifyListener(RunNotifier.java:225)
	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
	at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:222)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:53)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

Check failure on line 125 in src/test/java/io/cdap/plugin/gcp/bigquery/sink/BigQueryOutputFormatTest.java

See this annotation in the file changed.

@github-actions github-actions / Test Report

BigQueryOutputFormatTest.commitJobTestInsert10000BQInvocations

Unfinished stubbing detected here:
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)

E.g. thenReturn() may be missing.
Examples of correct stubbing:
    when(mock.isOk()).thenReturn(true);
    when(mock.isOk()).thenThrow(exception);
    doThrow(exception).when(mock).someVoidMethod();
Hints:
 1. missing thenReturn()
 2. you are trying to stub a final method, which is not supported
 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed
Raw output
org.mockito.exceptions.misusing.UnfinishedStubbingException: 
Unfinished stubbing detected here:
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)

E.g. thenReturn() may be missing.
Examples of correct stubbing:
    when(mock.isOk()).thenReturn(true);
    when(mock.isOk()).thenThrow(exception);
    doThrow(exception).when(mock).someVoidMethod();
Hints:
 1. missing thenReturn()
 2. you are trying to stub a final method, which is not supported
 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed

	at com.google.cloud.hadoop.io.bigquery.BigQueryHelper.getRawBigquery(BigQueryHelper.java:63)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:67)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.commitJobTestInsert10000BQInvocations(BigQueryOutputFormatTest.java:125)

Check failure on line 141 in src/test/java/io/cdap/plugin/gcp/bigquery/sink/BigQueryOutputFormatTest.java

See this annotation in the file changed.

@github-actions github-actions / Test Report

BigQueryOutputFormatTest.commitJobTestUpdateBQInvocations

No method found with name 'handleUpdateUpsertOperation' with parameter types: [ null, java.lang.Boolean, null, null, null, null ] in class io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormat$BigQueryOutputCommitter.
Raw output
org.powermock.reflect.exceptions.MethodNotFoundException: No method found with name 'handleUpdateUpsertOperation' with parameter types: [ null, java.lang.Boolean, null, null, null, null ] in class io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormat$BigQueryOutputCommitter.
	at org.powermock.reflect.internal.WhiteboxImpl.throwExceptionIfMethodWasNotFound(WhiteboxImpl.java:1128)
	at org.powermock.reflect.internal.WhiteboxImpl.findMethodOrThrowException(WhiteboxImpl.java:919)
	at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(WhiteboxImpl.java:813)
	at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(WhiteboxImpl.java:681)
	at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:401)
	at org.powermock.api.mockito.internal.expectation.PowerMockitoStubberImpl.when(PowerMockitoStubberImpl.java:105)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
	at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.commitJobTestUpdateBQInvocations(BigQueryOutputFormatTest.java:141)

Check failure on line 1 in Test mechanism

See this annotation in the file changed.

@github-actions github-actions / Test Report

Test mechanism

Misplaced or misused argument matcher detected here:

-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:92)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:93)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:94)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:95)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:96)

You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
    when(mock.get(anyInt())).thenReturn(null);
    doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
    verify(mock).someMethod(contains("foo"))

This message may appear after an NullPointerException if the last matcher is returning an object 
like any() but the stubbed method signature expect a primitive argument, in this case,
use primitive alternatives.
    when(mock.get(any())); // bad use, will raise NPE
    when(mock.get(anyInt())); // correct usage use

Also, this error might show up because you use argument matchers with methods that cannot be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
Mocking methods declared on non-public parent classes is not supported.
Raw output
org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
Misplaced or misused argument matcher detected here:

-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:92)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:93)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:94)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:95)
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:96)

You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
    when(mock.get(anyInt())).thenReturn(null);
    doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
    verify(mock).someMethod(contains("foo"))

This message may appear after an NullPointerException if the last matcher is returning an object 
like any() but the stubbed method signature expect a primitive argument, in this case,
use primitive alternatives.
    when(mock.get(any())); // bad use, will raise NPE
    when(mock.get(anyInt())); // correct usage use

Also, this error might show up because you use argument matchers with methods that cannot be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
Mocking methods declared on non-public parent classes is not supported.

	at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:87)
	at org.junit.runner.notification.RunNotifier$9.notifyListener(RunNotifier.java:225)
	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
	at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:222)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:53)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

Check failure on line 1 in src/test/java/io/cdap/plugin/gcp/bigquery/sqlengine/BigQuerySQLEngineTest.java

See this annotation in the file changed.

@github-actions github-actions / Test Report

BigQuerySQLEngineTest.initializationError

Unfinished stubbing detected here:
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)

E.g. thenReturn() may be missing.
Examples of correct stubbing:
    when(mock.isOk()).thenReturn(true);
    when(mock.isOk()).thenThrow(exception);
    doThrow(exception).when(mock).someVoidMethod();
Hints:
 1. missing thenReturn()
 2. you are trying to stub a final method, which is not supported
 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed
Raw output
org.mockito.exceptions.misusing.UnfinishedStubbingException: 
Unfinished stubbing detected here:
-> at io.cdap.plugin.gcp.bigquery.sink.BigQueryOutputFormatTest.initMocks(BigQueryOutputFormatTest.java:91)

E.g. thenReturn() may be missing.
Examples of correct stubbing:
    when(mock.isOk()).thenReturn(true);
    when(mock.isOk()).thenThrow(exception);
    doThrow(exception).when(mock).someVoidMethod();
Hints:
 1. missing thenReturn()
 2. you are trying to stub a final method, which is not supported
 3: you are stubbing the behaviour of another mock inside before 'thenReturn' instruction if completed

	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
	at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)