forked from RihanKh/OSAandSAST
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwireMockTest.java
More file actions
54 lines (37 loc) · 1.51 KB
/
wireMockTest.java
File metadata and controls
54 lines (37 loc) · 1.51 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.cx.automation.adk;
import com.cx.automation.adk.rest.RESTClient;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.glassfish.jersey.client.ClientResponse;
import net.lingala.zip4j.exception.ZipException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
/**
* Created by aviat.
* Date: 18/06/2018.
*/
@Ignore
public class wireMockTest {
@Test
public void wireMockTestExample() throws UnirestException, IOException, ZipException {
WireMockServer wireMockServer = new WireMockServer(wireMockConfig().port(8089));
wireMockServer.start();
wireMockServer.stubFor(any(urlPathEqualTo("/api/books"))
.willReturn(aResponse()
.withHeader("Content-Type", "text/json")
.withStatus(200)
.withBody("{}")));
RESTClient restClient = new RESTClient();
ClientResponse response = restClient.get("http://localhost:8089/api/books", MediaType.APPLICATION_JSON_TYPE);
Assert.assertEquals(response.getStatus(), 200);
String a = "\\\\10.45.0.108\\cxsrc";
}
@Test
public void seleniumHeadless(){
}
}