@Test
public void postWrongLicense() throws IOException{

    License license = DataModelFactory.createLicense("test", "longName", "comments", "regexp", "url");
    stubFor(post(urlEqualTo("/" + ServerAPI.LICENSE_RESOURCE))
            .withRequestBody(equalTo(JsonUtils.serialize(license)))
            .willReturn(aResponse()
                    .withStatus(Status.NOT_ACCEPTABLE.getStatusCode())));
    Exception exception = null;
    try{
        client.postLicense(license, "user", "password");
    }catch (Exception e) {
        exception = e;
    }
    assertNotNull(exception);
}