Package org.candlepin.common.config

Examples of org.candlepin.common.config.Configuration


        assertTrue(adapter.canActivateSubscription(consumer));
    }

    @Test
    public void activationPrefixFailure() {
        Configuration config = Mockito.mock(Configuration.class);
        Mockito.when(config.getString(ConfigProperties.ACTIVATION_DEBUG_PREFIX))
                .thenReturn("mega");

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("superman");
View Full Code Here


        assertFalse(adapter.canActivateSubscription(consumer));
    }

    @Test
    public void activationPrefixEmpty() {
        Configuration config = Mockito.mock(Configuration.class);
        Mockito.when(config.getString(ConfigProperties.ACTIVATION_DEBUG_PREFIX))
                .thenReturn("");

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("anything");
View Full Code Here

        assertFalse(adapter.canActivateSubscription(consumer));
    }

    @Test
    public void activationPrefixNull() {
        Configuration config = Mockito.mock(Configuration.class);
        Mockito.when(config.getString(ConfigProperties.ACTIVATION_DEBUG_PREFIX))
                .thenReturn(null);

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("anything");
View Full Code Here

        "/content/beta/rhel/$releasever/$basearch/debug",
        "/content/beta/rhel/$releasever/$basearch/source/SRPMS"};

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

        certServiceAdapter = new DefaultEntitlementCertServiceAdapter(
            mockedPKI, extensionUtil, v3extensionUtil,
View Full Code Here

    }

    @Test
    public void ensureV3CertificateCreationOkWhenConsumerSupportsV3Dot1Certs()
        throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getFact(eq("system.certificate_version"))).thenReturn("3.2");
        ProductAttribute attr = new ProductAttribute("ram", "4");
        subscription.getProduct().addAttribute(attr);
View Full Code Here

            any(String.class));
    }

    @Test
    public void ensureV3CertIsCreatedWhenEnableCertV3ConfigIsTrue() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getFact(eq("system.certificate_version"))).thenReturn("3.0");

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
        X509ExtensionUtil mockExtensionUtil = mock(X509ExtensionUtil.class);
View Full Code Here

        verifyZeroInteractions(mockExtensionUtil);
    }

    @Test
    public void ensureV3CertIsCreatedWhenV3CapabilityPresent() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.CANDLEPIN));

        Set<ConsumerCapability> set = new HashSet<ConsumerCapability>();
View Full Code Here

    }


    @Test
    public void ensureV1CertIsCreatedWhenV3factNotPresent() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
View Full Code Here

        verifyZeroInteractions(mockV3extensionUtil);
    }

    @Test
    public void ensureV3CertIsCreatedWhenHypervisor() throws Exception {
        Configuration mockConfig = mock(Configuration.class);

        when(consumer.getType()).thenReturn(
            new ConsumerType(ConsumerType.ConsumerTypeEnum.HYPERVISOR));

        X509V3ExtensionUtil mockV3extensionUtil = mock(X509V3ExtensionUtil.class);
View Full Code Here

*/
public class BouncyCastlePKIReaderTest {

    @Test
    public void readkey() throws CertificateException {
        Configuration config = new MapConfiguration(
            new HashMap<String, String>() {

                {
                    put(ConfigProperties.CA_CERT,
                        "target/test/resources/certs/test.crt");
View Full Code Here

TOP

Related Classes of org.candlepin.common.config.Configuration

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.