// pre-condition
IApplication application = ApplicationTestUtils.ensureHasExactly1Application(domain);
IEmbeddableCartridge mySqlEmbeddableCartridge =
LatestVersionOf.mySQL().get(user);
EmbeddedCartridgeTestUtils.ensureHasEmbeddedCartridge(mySqlEmbeddableCartridge, application);
assertThat(new ApplicationAssert(application)
.hasEmbeddedCartridge(LatestVersionOf.mySQL()));
// operation
// use user instance that's not the one used to create
IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
IApplication user2Application = user2.getDefaultDomain().getApplicationByName(application.getName());
user2Application.removeEmbeddedCartridge(LatestVersionOf.mySQL().get(user2));
assertThat(new ApplicationAssert(user2Application)
.hasNotEmbeddableCartridges(LatestVersionOf.mySQL()));
// verification
application.refresh();
assertThat(new ApplicationAssert(application)
.hasNotEmbeddableCartridges(LatestVersionOf.mySQL()));
assertEquals(application.getEmbeddedCartridges().size(), user2Application.getEmbeddedCartridges().size());
}