@Test
public final void testDoPostShouldCallJsonBuilderAndWriteResponse() throws Exception {

    // GIVEN
    given(properties.getMaintainerProperties()).willReturn(maintainerProperties);
    given(response.getWriter()).willReturn(printWriter);
    given(maintainerPropertiesJsonBuilder.buildMaintainerPropertiesJson(maintainerProperties)).willReturn("json");
    // WHEN
    underTest.doPost(request, response);
    // THEN
    verify(response).setContentType("application/json");
    verify(printWriter).write("json");
    verify(printWriter).flush();
    verify(printWriter).close();
}