Commit 00c9ca0e authored by Guillaume Thomazon's avatar Guillaume Thomazon
Browse files
parent 69d36b71
......@@ -234,5 +234,24 @@
<artifactId>metainf-services</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package net.ihe.gazelle.wstester.action;
import net.ihe.gazelle.simulator.common.model.ApplicationConfiguration;
import net.ihe.gazelle.wstester.model.Execution;
import net.ihe.gazelle.wstester.model.TestInstanceResult;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.Arrays;
import java.util.List;
import static org.mockito.Mockito.when;
@RunWith(PowerMockRunner.class)
@PrepareForTest({ApplicationConfiguration.class})
@PowerMockIgnore({"org.xml.*", "org.w3c.*", "javax.xml.*", "javax.net.ssl.*","javax.security.*"})
public class RunInstanceActionTest2 {
@Before
public void setUp() throws Exception {
mockApplicationConfiguration();
}
@After
public void tearDown() throws Exception {
}
@Test
public void getSystemKeywordInfoOK() {
RunInstanceAction runInstanceAction = new RunInstanceAction();
Execution execution = new Execution();
TestInstanceResult testInstanceResult = new TestInstanceResult();
testInstanceResult.setTestInstance(36575);
runInstanceAction.setExecution(execution);
List<String> transaction = Arrays.asList("ITI-18");
String res = runInstanceAction.getSystemKeywordInfo(transaction).get(0).getResponderSystemKeyword();
Assert.assertEquals("Core Community Component_Post_0", res);
}
private void mockApplicationConfiguration() {
PowerMockito.mockStatic(ApplicationConfiguration.class);
when(ApplicationConfiguration.getValueOfVariable("tm_domain")).thenReturn("https://ehealthsuisse.ihe-europe.net/");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment