DefaultActionInvoker implements IActionInvoker { protected IBackgroundExecutionStreamProvider getStreamProvider( final Map<String, Serializable> params ) { if ( params == null ) { logger.warn( Messages.getInstance().getMapNullCantReturnSp() ); return null; } final Object obj = params.get( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER ); return ( obj instanceof IBackgroundExecutionStreamProvider ) ? (IBackgroundExecutionStreamProvider) obj : null; }  void validate( final IAction actionBean, final String actionUser,
                        final Map<String, Serializable> params ); @Override IActionInvokeStatus invokeAction( final IAction actionBean,
                                           final String actionUser,
                                           final Map<String, Serializable> params ); @Override boolean isSupportedAction( IAction action );  }
@Test public void testGetStreamProvider() throws Exception { final DefaultActionInvoker ai = new DefaultActionInvoker(); final Map<String, Serializable> params = new HashMap<>(); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( "foo", "bar" ); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER, null ); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER, 1 ); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER, true ); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER, "streamProviderFoo" ); Assert.assertNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); params.put( QuartzScheduler.RESERVEDMAPKEY_STREAMPROVIDER, Mockito.mock( IBackgroundExecutionStreamProvider.class ) ); Assert.assertNotNull( Whitebox.invokeMethod( ai,"getStreamProvider", params ) ); }