@Test
public void getLicense() throws IOException {

    License license1 = DataModelFactory.createLicense("test", "longName", "comments", "regexp", "url");
    stubFor(get(urlEqualTo("/" + ServerAPI.LICENSE_RESOURCE + "/" + license1.getName()))
            .willReturn(aResponse()
                    .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                    .withBody(JsonUtils.serialize(license1))
                    .withStatus(Status.OK.getStatusCode())));
    Exception exception = null;
    License license2 = null;
    try{
        license2 = client.getLicense(license1.getName());
    }catch (Exception e) {
        exception = e;
    }
    assertNull(exception);
    assertNotNull(license2);
    assertEquals(license1, license2);
}