org.mockserver.junit.MockServerRule Java Examples

The following examples show how to use org.mockserver.junit.MockServerRule. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SplunkIOTest.java    From DataflowTemplates with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
  try {
    mockServerRule = new MockServerRule(this);
  } catch (Exception e) {
    assumeNoException(e);
  }
}
 
Example #2
Source File: SplunkEventWriterTest.java    From DataflowTemplates with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
  try {
    mockServerRule = new MockServerRule(this);
  } catch (Exception e) {
    assumeNoException(e);
  }
}
 
Example #3
Source File: TestUtility.java    From gitlab-plugin with GNU General Public License v2.0 5 votes vote down vote up
static void setupGitLabConnections(JenkinsRule jenkins, MockServerRule mockServer) throws IOException {
    GitLabConnectionConfig connectionConfig = jenkins.get(GitLabConnectionConfig.class);
    String apiTokenId = "apiTokenId";
    for (CredentialsStore credentialsStore : CredentialsProvider.lookupStores(Jenkins.getInstance())) {
        if (credentialsStore instanceof SystemCredentialsProvider.StoreImpl) {
            List<Domain> domains = credentialsStore.getDomains();
            credentialsStore.addCredentials(domains.get(0),
                new StringCredentialsImpl(CredentialsScope.SYSTEM, apiTokenId, "GitLab API Token", Secret.fromString(TestUtility.API_TOKEN)));
        }
    }
    connectionConfig.addConnection(new GitLabConnection(TestUtility.GITLAB_CONNECTION_V3, "http://localhost:" + mockServer.getPort() + "/gitlab", apiTokenId, new V3GitLabClientBuilder(), false, 10, 10));
    connectionConfig.addConnection(new GitLabConnection(TestUtility.GITLAB_CONNECTION_V4, "http://localhost:" + mockServer.getPort() + "/gitlab", apiTokenId, new V4GitLabClientBuilder(), false, 10, 10));

}