I am using MockServer and MockResponse as follows -
@Before
public void startup() throws Exception {
server = new MockWebServer();
server.start();
}
@After
public void tearDown() throws Exception {
server.shutdown();
}
@Test
public void http_Response() throws Exception{
server.enqueue(new MockResponse().setResponseCode(500));
...
...
assert(getErrorCode(), 500);
}
I do not understand how mockResponse object is used internally by MockWebServer and why it is used in that fashion? (At a higher level, I am trying to understand why my asserts are failing, but I will get to that later) Tried searching documentation and tutorial, but there does not seems to be lucid explanations out there.
Aucun commentaire:
Enregistrer un commentaire