@Test
public void capabilityOfTypeIsActive() {
removeAllMessageCapabilities();
Capability capability = capabilities().create("[capabilityOfTypeActive]")
.save();
MatcherAssert.assertThat(capability.isActive(), is(false));
logRemote("Create a capability of type [message]");
final Capability messageCapability = capabilities().create("[message]")
.withProperty("repository", "releases")
.save();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(true));
logRemote("Disable capability of type [message]");
messageCapability.disable();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(false));
logRemote("Enable capability of type [message]");
messageCapability.enable();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(true));
logRemote("Remove capability of type [message]");
messageCapability.remove();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(false));
}