Package org.candlepin.service.impl

Examples of org.candlepin.service.impl.DefaultEntitlementCertServiceAdapter


    public void setUp() {
        Configuration config = new CandlepinCommonTestConfig();
        extensionUtil = new X509ExtensionUtil(config);
        v3extensionUtil = new X509V3ExtensionUtil(config, entCurator);

        certServiceAdapter = new DefaultEntitlementCertServiceAdapter(
            mockedPKI, extensionUtil, v3extensionUtil,
            mock(EntitlementCertificateCurator.class), keyPairCurator,
            serialCurator, productAdapter, entCurator,
            I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK),
            config);
View Full Code Here


        subscription.getProduct().addAttribute(attr);

        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);
    }
View Full Code Here

        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));
View Full Code Here

        when(consumer.getCapabilities()).thenReturn(set);

        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));
View Full Code Here

            new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));

        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 v1
        verify(mockExtensionUtil).consumerExtensions(eq(consumer));
        verifyZeroInteractions(mockV3extensionUtil);
    }
View Full Code Here

            new ConsumerType(ConsumerType.ConsumerTypeEnum.HYPERVISOR));

        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));
View Full Code Here

TOP

Related Classes of org.candlepin.service.impl.DefaultEntitlementCertServiceAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.