final MavenHostedRepository repository = repositories().create(MavenHostedRepository.class, rId)
.excludeFromSearchResults()
.save();
Capability capability = capabilities().create("[repositoryIsInService]")
.withProperty("repository", rId)
.save();
MatcherAssert.assertThat(capability.isActive(), is(true));
logRemote("Put repository '{}' out of service", rId);
repository.putOutOfService();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(false));
logRemote("Put repository '{}' back in service", rId);
repository.putInService();
capability.refresh();
MatcherAssert.assertThat(capability.isActive(), is(true));
}