when(consumer.getFact(eq("system.certificate_version"))).thenReturn("3.0");
X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
X509ExtensionUtil mockExtensionUtil = mock(X509ExtensionUtil.class);
DefaultEntitlementCertServiceAdapter entAdapter =
new DefaultEntitlementCertServiceAdapter(
mockedPKI, mockExtensionUtil, mockV3extensionUtil,
mock(EntitlementCertificateCurator.class), keyPairCurator,
serialCurator, productAdapter, entCurator,
I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK),
mockConfig);
entAdapter.createX509Certificate(entitlement,
product, new HashSet<Product>(), new BigInteger("1234"), keyPair(), true);
verify(mockV3extensionUtil).getExtensions(eq(entitlement), any(String.class),
any(Map.class));
verify(mockV3extensionUtil).getByteExtensions(any(Set.class),
eq(entitlement), any(String.class), any(Map.class));