Package org.candlepin.model

Examples of org.candlepin.model.CertificateSerial


        return createIdCert(new Date());
    }

    public static IdentityCertificate createIdCert(Date expiration) {
        IdentityCertificate idCert = new IdentityCertificate();
        CertificateSerial serial = new CertificateSerial(expiration);
        serial.setId(Long.valueOf(new Random().nextInt(1000000)));

        // totally arbitrary
        idCert.setId(String.valueOf(new Random().nextInt(1000000)));
        idCert.setKey("uh0876puhapodifbvj094");
        idCert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
 
View Full Code Here


        when(psa.getProductById("MKT-sub-prod")).thenReturn(subProduct);
        when(psa.getProductById("332211")).thenReturn(subProvidedProduct);
        when(psa.getProductCertificate(any(Product.class))).thenReturn(pcert);
        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");
        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");

        when(ec.listByConsumer(consumer)).thenReturn(entitlements);
        when(ent.getDirty()).thenReturn(true);
        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

            "signature".getBytes());
        when(rc.getRules()).thenReturn(mrules);
        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");

        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");

        // specific to this test
        IdentityCertificate idcert = new IdentityCertificate();
        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");

        // specific to this test
        IdentityCertificate idcert = new IdentityCertificate();
        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

        when(rc.getRules()).thenReturn(mrules);
        when(pprov.get()).thenReturn(principal);
        when(principal.getUsername()).thenReturn("testUser");

        IdentityCertificate idcert = new IdentityCertificate();
        idcert.setSerial(new CertificateSerial(10L, new Date()));
        idcert.setKey("euh0876puhapodifbvj094");
        idcert.setCert("hpj-08ha-w4gpoknpon*)&^%#");
        idcert.setCreated(new Date());
        idcert.setUpdated(new Date());
        when(consumer.getIdCert()).thenReturn(idcert);
View Full Code Here

    @Test
    public void getSerial() {
        CertificateSerialCurator csc = mock(CertificateSerialCurator.class);
        CertificateSerialResource csr = new CertificateSerialResource(csc);
        CertificateSerial cs = mock(CertificateSerial.class);
        when(csc.find(10L)).thenReturn(cs);
        assertEquals(cs, csr.getCertificateSerial(10L));
    }
View Full Code Here

        List<X509CRLEntryWrapper> entries = this.generator
            .getNewSerialsToAppendAndSetThemConsumed();
        assertEquals(entries.size(), serials.size());
        verify(this.curator).saveOrUpdateAll(serials);
        for (int i = 0; i < serials.size(); i++) {
            CertificateSerial cs = serials.get(i);
            assertEquals(cs.getSerial(), entries.get(i).getSerialNumber());
        }
    }
View Full Code Here

            }
        };
    }

    private CertificateSerial stubCS(Long id, Date expiration) {
        CertificateSerial cs = new CertificateSerial(id, expiration);
        cs.setCollected(false);
        return cs;
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.CertificateSerial

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.