Source:
<code>public void testExceptionsArePrintedToLog() throws KettleException { ProgressBar progressBar = Mockito.mock( ProgressBar.class ); RuntimeTestStatus clusterTestStatus = Mockito.mock( RuntimeTestStatus.class ); Label testLabel = Mockito.mock( Label.class ); RuntimeTestModuleResults runtimeTestModuleResults = Mockito.mock( RuntimeTestModuleResults.class ); RuntimeTestResult result = Mockito.mock( RuntimeTestResult.class ); RuntimeTestResultEntry entry = Mockito.mock( RuntimeTestResultEntry.class ); ArrayList<RuntimeTestModuleResults> results = new ArrayList<>(); results.add( runtimeTestModuleResults ); ArrayList<RuntimeTestResult> runtimeTestResults = new ArrayList<>(); runtimeTestResults.add( result ); ArrayList<RuntimeTestResultEntry> entries = new ArrayList<>(); entries.add( entry ); entries.add( entry ); Mockito.when( clusterTestStatus.getModuleResults() ).thenReturn( results ); Mockito.when( clusterTestStatus.isDone() ).thenReturn( true ); Mockito.when( runtimeTestModuleResults.getRuntimeTestResults() ).thenReturn( runtimeTestResults ); Mockito.when( result.getRuntimeTest() ).thenReturn( Mockito.mock( RuntimeTest.class ) ); Mockito.when( result.getRuntimeTestResultEntries() ).thenReturn( entries ); Mockito.when( entry.getSeverity() ).thenReturn( RuntimeTestEntrySeverity.FATAL ); Mockito.when( entry.getException() ).thenReturn( new Exception() ); testDialog.getRunnable( progressBar, clusterTestStatus, testLabel ).run(); <START> Mockito.verify( entry, Mockito.times( 4 ) ).getException(); <END> }</code><technical_language><LINK_0> mock LogChannel check mock logBasic called, getException entry</technical_language>

Target:
public void testExceptionsArePrintedToLog() throws KettleException { ProgressBar progressBar = Mockito.mock( ProgressBar.class ); RuntimeTestStatus clusterTestStatus = Mockito.mock( RuntimeTestStatus.class ); Label testLabel = Mockito.mock( Label.class ); RuntimeTestModuleResults runtimeTestModuleResults = Mockito.mock( RuntimeTestModuleResults.class ); RuntimeTestResult result = Mockito.mock( RuntimeTestResult.class ); RuntimeTestResultEntry entry = Mockito.mock( RuntimeTestResultEntry.class ); Exception exception = new Exception(); ArrayList<RuntimeTestModuleResults> results = new ArrayList<>(); results.add( runtimeTestModuleResults ); ArrayList<RuntimeTestResult> runtimeTestResults = new ArrayList<>(); runtimeTestResults.add( result ); ArrayList<RuntimeTestResultEntry> entries = new ArrayList<>(); entries.add( entry ); entries.add( entry ); Mockito.when( clusterTestStatus.getModuleResults() ).thenReturn( results ); Mockito.when( clusterTestStatus.isDone() ).thenReturn( true ); Mockito.when( runtimeTestModuleResults.getRuntimeTestResults() ).thenReturn( runtimeTestResults ); Mockito.when( result.getRuntimeTest() ).thenReturn( Mockito.mock( RuntimeTest.class ) ); Mockito.when( result.getRuntimeTestResultEntries() ).thenReturn( entries ); Mockito.when( entry.getSeverity() ).thenReturn( RuntimeTestEntrySeverity.FATAL ); Mockito.when( entry.getException() ).thenReturn( exception ); testDialog.getRunnable( progressBar, clusterTestStatus, testLabel ).run(); Mockito.verify( logChannelInterface, Mockito.times( 2 ) ).logBasic( ExceptionUtils.getStackTrace( exception ) ); }