// add an identity certificate for the export
IdentityCertificate idCert = TestUtil.createIdCert();
idCert.setId(null); // needs to be null to persist
idCert.getSerial().setId(null); // needs to be null to persist
certSerialCurator.create(idCert.getSerial());
IdentityCertificateCurator idCurator =
injector.getInstance(IdentityCertificateCurator.class);
idCurator.create(idCert);
consumer.setIdCert(idCert);
consumer.setType(consumerTypeCurator.create(
new ConsumerType(ConsumerTypeEnum.CANDLEPIN)));
consumerCurator.update(consumer);