@Test
public void createReadDelete()
throws Exception
{
// create a certificate
final Certificate created = truststore().create()
.withPem(FileUtils.readFileToString(testData().resolveFile("pem.txt")))
.save();
// check there are at list one certificate
final Collection<Certificate> certificates = truststore().get();
assertThat(certificates.size(), greaterThan(0));
// check that we can get the created certificate
final Certificate updated = truststore().get(created.id());
assertThat(updated, is(equalTo(created)));
// remove the certificate
updated.remove();
thrown.expect(exceptionWithStatus(Status.NOT_FOUND));
truststore().get(created.id());
}