-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PDI-16885] Values of parameters are not passed on when using the Pen…
…taho Server run config - The filling of parameters from the execution configuration has been added - PDI Parameters has been added to scheduler request
- Loading branch information
1 parent
c4a1591
commit 0be5af8
Showing
4 changed files
with
119 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...java/org/pentaho/di/engine/configuration/impl/pentaho/scheduler/SchedulerRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.pentaho.di.engine.configuration.impl.pentaho.scheduler; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.pentaho.di.base.AbstractMeta; | ||
import org.pentaho.di.core.parameters.UnknownParamException; | ||
import org.pentaho.di.repository.RepositoryDirectoryInterface; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
|
||
import static org.mockito.Mockito.doCallRealMethod; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.verify; | ||
import static org.mockito.Mockito.doReturn; | ||
|
||
public class SchedulerRequestTest { | ||
private static final String EMPTY_STRING = ""; | ||
private static final String TEST_PARAM_NAME = "paramName"; | ||
private static final String[] ARRAY_WITH_PARAM_NAME = new String[]{TEST_PARAM_NAME}; | ||
|
||
private SchedulerRequest schedulerRequest; | ||
|
||
@Before | ||
public void before() { | ||
schedulerRequest = mock( SchedulerRequest.class ); | ||
} | ||
|
||
@Test | ||
@SuppressWarnings( "ResultOfMethodCallIgnored" ) | ||
public void testBuildSchedulerRequestEntity() throws UnknownParamException, UnsupportedEncodingException { | ||
AbstractMeta abstractMeta = mock( AbstractMeta.class ); | ||
RepositoryDirectoryInterface repositoryDirectoryInterface = mock( RepositoryDirectoryInterface.class ); | ||
|
||
doReturn( repositoryDirectoryInterface ).when( abstractMeta ).getRepositoryDirectory(); | ||
doReturn( EMPTY_STRING ).when( repositoryDirectoryInterface ).getPath(); | ||
doReturn( EMPTY_STRING ).when( abstractMeta ).getName(); | ||
doReturn( EMPTY_STRING ).when( abstractMeta ).getDefaultExtension(); | ||
doReturn( ARRAY_WITH_PARAM_NAME ).when( abstractMeta ).listParameters(); | ||
|
||
doCallRealMethod().when( schedulerRequest ).buildSchedulerRequestEntity( abstractMeta ); | ||
schedulerRequest.buildSchedulerRequestEntity( abstractMeta ); | ||
|
||
verify( abstractMeta ).listParameters(); | ||
verify( abstractMeta ).getParameterValue( TEST_PARAM_NAME ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters