public class MockServerRule extends Object implements org.junit.rules.TestRule
Constructor and Description |
---|
MockServerRule(Object target)
Start the MockServer prior to test execution and stop the MockServer after the tests have completed.
|
MockServerRule(Object target,
boolean perTestSuite)
Start the MockServer prior to test execution and stop the MockServer after the tests have completed.
|
MockServerRule(Object target,
boolean perTestSuite,
Integer... ports)
Start the proxy prior to test execution and stop the proxy after the tests have completed.
|
MockServerRule(Object target,
Integer... ports)
Start the proxy prior to test execution and stop the proxy after the tests have completed.
|
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
MockServerClient |
getClient() |
Integer |
getPort() |
Integer[] |
getPorts() |
public MockServerRule(Object target)
target
- an instance of the test being executedpublic MockServerRule(Object target, boolean perTestSuite)
target
- an instance of the test being executedperTestSuite
- indicates how many instances of MockServer are created
if true a single MockServer is created per JVM
if false one instance per test class is createdpublic MockServerRule(Object target, Integer... ports)
target
- an instance of the test being executedports
- the HTTP(S) port for the proxypublic MockServerRule(Object target, boolean perTestSuite, Integer... ports)
target
- an instance of the test being executedperTestSuite
- indicates how many instances of MockServer are createdports
- the HTTP(S) port for the proxypublic Integer getPort()
public Integer[] getPorts()
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
public MockServerClient getClient()
Copyright © 2020. All rights reserved.