forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPaymentServiceContractTest.java
35 lines (29 loc) · 1.03 KB
/
PaymentServiceContractTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mock.contract;
import com.intuit.karate.junit4.Karate;
import cucumber.api.CucumberOptions;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.context.ConfigurableApplicationContext;
/**
*
* @author pthomas3
*/
@RunWith(Karate.class)
@CucumberOptions(features = "classpath:mock/contract/payment-service.feature")
public class PaymentServiceContractTest {
private static ConfigurableApplicationContext context;
@BeforeClass
public static void beforeClass() {
System.setProperty("karate.env", "contract");
String queueName = "DEMO.CONTRACT";
context = PaymentService.start(queueName, false);
String paymentServiceUrl = "http://localhost:" + PaymentService.getPort(context);
System.setProperty("payment.service.url", paymentServiceUrl);
System.setProperty("shipping.queue.name", queueName);
}
@AfterClass
public static void afterClass() {
PaymentService.stop(context);
}
}