@Test
public void testCreateServiceInfo() {

    Map<String, Object> empty = new HashMap<String, Object>();
    Map<String, Object> badTypes = new HashMap<String, Object>();
    badTypes.put("name", 1);
    Map<String, Object> badCredTypes = new HashMap<String, Object>();
    badCredTypes.put("username", 1);
    badCredTypes.put("password", 1);
    badCredTypes.put("host", 1);
    badCredTypes.put("url", 1);
    badCredTypes.put("port", "1");
    badTypes.put("credentials", badCredTypes);
    Map<String, Object> rawInfo = new HashMap<String, Object>();
    rawInfo.put("name", "id");
    Map<String, Object> rawInfoCreds = new HashMap<String, Object>();
    rawInfoCreds.put("username", "username");
    rawInfoCreds.put("password", "password");
    rawInfoCreds.put("host", "host");
    rawInfoCreds.put("url", "url");
    rawInfoCreds.put("port", 443);
    rawInfo.put("credentials", rawInfoCreds);
    CloudantServiceInfo nullServiceInfo = new CloudantServiceInfo(null, null, null, null, 0, null);
    CloudantServiceInfo serviceInfo = new CloudantServiceInfo("id", "username", "password", "host", 443, "url");
    assertEquals(nullServiceInfo, creator.createServiceInfo(empty));
    assertEquals(nullServiceInfo, creator.createServiceInfo(badTypes));
    assertEquals(serviceInfo, creator.createServiceInfo(rawInfo));
}