Search in sources :

Example 1 with JsonTestUser2

use of com.dtflys.test.http.model.JsonTestUser2 in project forest by dromara.

the class TestPostClient method testPostJsonObjectWithLog_content_noStatus2.

@Test
public void testPostJsonObjectWithLog_content_noStatus2() {
    server.enqueue(new MockResponse().setBody(EXPECTED));
    ForestLogHandler logHandler = configuration.getLogHandler();
    ForestLogger logger = Mockito.mock(ForestLogger.class);
    logHandler.setLogger(logger);
    JsonTestUser2 user = new JsonTestUser2();
    user.setUsername("foo");
    assertThat(postClient.postJsonObjectWithLog_content_noStatus(user)).isNotNull().isEqualTo(EXPECTED);
    Mockito.verify(logger).info("[Forest] Response Content:\n\t" + EXPECTED);
}
Also used : MockResponse(okhttp3.mockwebserver.MockResponse) ForestLogHandler(com.dtflys.forest.logging.ForestLogHandler) ForestLogger(com.dtflys.forest.logging.ForestLogger) JsonTestUser2(com.dtflys.test.http.model.JsonTestUser2) Test(org.junit.Test)

Aggregations

ForestLogHandler (com.dtflys.forest.logging.ForestLogHandler)1 ForestLogger (com.dtflys.forest.logging.ForestLogger)1 JsonTestUser2 (com.dtflys.test.http.model.JsonTestUser2)1 MockResponse (okhttp3.mockwebserver.MockResponse)1 Test (org.junit.Test)1