SimpleName:IDENTIFIER 84 testInvalidRevokedStartDate testInvalidRevokedStartDate

SimpleName:IDENTIFIER 84 Exception Exception

@Test
public void testInvalidRevokedStartDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setRevokedStart(null);
}

@Test(expected = InvalidArgumentException.class)
public void testInvalidRevokedStartDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setRevokedStart(null);
}

package org.hyperledger.fabric_ca.sdk;

import java.io.File;
import java.net.MalformedURLException;
import org.hyperledger.fabric.sdk.exception.CryptoException;
import org.hyperledger.fabric.sdk.security.CryptoPrimitives;
import org.hyperledger.fabric.sdkintegration.SampleStore;
import org.hyperledger.fabric.sdkintegration.SampleUser;
import org.hyperledger.fabric_ca.sdk.exception.EnrollmentException;
import org.hyperledger.fabric_ca.sdk.exception.HFCACertificateException;
import org.hyperledger.fabric_ca.sdk.exception.InvalidArgumentException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class adhoc_HFCACertificateRequestTest {

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    private static final String TEST_ADMIN_NAME = "admin";

    private static final String TEST_ADMIN_ORG = "org1";

    private SampleStore sampleStore;

    SampleUser admin;

    private static CryptoPrimitives crypto;

    @BeforeClass
    public static void setupBeforeClass() {
        try {
            crypto = new CryptoPrimitives();
            crypto.init();
        } catch (Exception e) {
            throw new RuntimeException("HFCAAffiliationTest.setupBeforeClass failed!", e);
        }
    }

    @Before
    public void setup() throws CryptoException, InvalidArgumentException, org.hyperledger.fabric.sdk.exception.InvalidArgumentException, MalformedURLException, EnrollmentException {
        File sampleStoreFile = new File(System.getProperty("java.io.tmpdir") + "/HFCSampletest.properties");
        if (sampleStoreFile.exists()) {
            sampleStoreFile.delete();
        }
        sampleStore = new SampleStore(sampleStoreFile);
        sampleStoreFile.deleteOnExit();
        admin = sampleStore.getMember(TEST_ADMIN_NAME, TEST_ADMIN_ORG);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 96 testInvalidRevokedEndDate testInvalidRevokedEndDate

SimpleName:IDENTIFIER 96 Exception Exception

@Test
public void testInvalidRevokedEndDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setRevokedEnd(null);
}

@Test(expected = InvalidArgumentException.class)
public void testInvalidRevokedEndDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setRevokedEnd(null);
}


SimpleName:IDENTIFIER 108 testInvalidExpiredStartDate testInvalidExpiredStartDate

SimpleName:IDENTIFIER 108 Exception Exception

@Test
public void testInvalidExpiredStartDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setExpiredStart(null);
}

@Test(expected = InvalidArgumentException.class)
public void testInvalidExpiredStartDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setExpiredStart(null);
}


SimpleName:IDENTIFIER 120 testInvalidExpiredEndDate testInvalidExpiredEndDate

SimpleName:IDENTIFIER 120 Exception Exception

@Test
public void testInvalidExpiredEndDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setExpiredEnd(null);
}

@Test(expected = InvalidArgumentException.class)
public void testInvalidExpiredEndDate() throws Exception {
    HFCAClient client = HFCAClient.createNewInstance("http://localhost:99", null);
    client.setCryptoSuite(crypto);
    HFCACertificateRequest certReq = client.newHFCACertificateRequest();
    certReq.setExpiredEnd(null);
}


SimpleName:IDENTIFIER 79 testNewInstanceSetNullID testNewInstanceSetNullID

SimpleName:IDENTIFIER 82 RegistrationRequest RegistrationRequest

SimpleName:IDENTIFIER 82 regAffiliation regAffiliation

"Expected exception when null is specified for id"

@Test
public void testNewInstanceSetNullID() {
    new RegistrationRequest(null, regAffiliation);
}

@Test(expected = Exception.class)
public void testNewInstanceSetNullID() {
    new RegistrationRequest(null, regAffiliation);
}

package org.hyperledger.fabric_ca.sdk;

import javax.json.JsonObject;
import org.junit.Assert;
import org.junit.Test;

public class adhoc_RegistrationRequestTest {

    private static final String attrName = "some name";

    private static final String attrValue = "some value";

    private static final String regAffiliation = "corporation";

    private static final String regCAName = "CA";

    private static final String regID = "userid";

    private static final String regSecret = "secret";

    private static final String regType = HFCAClient.HFCA_TYPE_CLIENT;

    private static final int regMaxEnrollments = 5;
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 91 testNewInstanceSetNullAffiliation testNewInstanceSetNullAffiliation

SimpleName:IDENTIFIER 94 RegistrationRequest RegistrationRequest

"Expected exception when null is specified for affiliation"

@Test
public void testNewInstanceSetNullAffiliation() {
    new RegistrationRequest(regID, null);
}

@Test(expected = Exception.class)
public void testNewInstanceSetNullAffiliation() {
    new RegistrationRequest(regID, null);
}


SimpleName:IDENTIFIER 104 expected expected

SimpleName:IDENTIFIER 104 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 105 testInvalidGetTrigger testInvalidGetTrigger

SimpleName:IDENTIFIER 106 getTrigger getTrigger

@Test(expected = IllegalArgumentException.class)
public void testInvalidGetTrigger() {
    UEL.getTrigger("foo[bar].baz");
}

package uelbox;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import org.junit.Before;
import org.junit.Test;

public class adhoc_UELTest {

    private ELContext context;

    @Before
    public void setup() {
        context = new SimpleELContext();
    }
    /*TEST PLACEHOLDER*/
}