@Test
public void testDeleteProfile() throws Exception {
if (!this.doTests) return;
Fabric8ConnectorType connectorType = Fabric8TestHelpers.getJolokiaConnector();
Fabric8Connector con = new Fabric8Connector(connectorType);
try {
assertNotNull("Connector is null!", con);
con.connect();
assertNotNull("Connector Type is null!", con.getConnection());
Fabric8Facade fabric8 = con.getConnection().getFabricFacade();
assertNotNull("Fabric8 DTO is null!", fabric8);
VersionDTO version = fabric8.getDefaultVersion();
assertNotNull("Default version is null", version);
ProfileDTO profile = fabric8.createProfile(version.getId(), "unitTestProfileIDE");
assertNotNull("createProfile returns null when created profile", profile);
ProfileDTO profile2 = fabric8.getProfile(version.getId(), "unitTestProfileIDE");
assertNotNull("getProfile returns null for created profile", profile2);
fabric8.deleteProfile(version.getId(), profile2.getId());
profile2 = fabric8.getProfile(version.getId(), "unitTestProfileIDE");
assertNull("The profile hasn't been deleted from backstore", profile2);
} catch (IOException ex) {
fail(ex.getMessage());
} finally {
con.disconnect();
}
}