use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockEnrollment in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadEnrollmentBadKey.
@Test(expected = InvalidArgumentException.class)
public void testBadEnrollmentBadKey() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(USER_NAME, USER_MSP_ID);
MockEnrollment mockEnrollment = TestUtils.getMockEnrollment(null, "mockCert");
mockUser.setEnrollment(mockEnrollment);
client.setUserContext(mockUser);
}
use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockEnrollment in project fabric-sdk-java by hyperledger.
the class ClientTest method testCryptoFactory.
// (expected = InvalidArgumentException.class)
@Test
@Ignore
public void testCryptoFactory() throws Exception {
try {
resetConfig();
Assert.assertNotNull(Config.getConfig().getDefaultCryptoSuiteFactory());
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(USER_NAME, USER_MSP_ID);
MockEnrollment mockEnrollment = TestUtils.getMockEnrollment(null, "mockCert");
mockUser.setEnrollment(mockEnrollment);
client.setUserContext(mockUser);
} finally {
System.getProperties().remove("org.hyperledger.fabric.sdk.crypto.default_crypto_suite_factory");
}
}
use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockEnrollment in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadEnrollmentBadCert.
@Test(expected = InvalidArgumentException.class)
public void testBadEnrollmentBadCert() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(USER_NAME, USER_MSP_ID);
MockEnrollment mockEnrollment = TestUtils.getMockEnrollment(null);
mockUser.setEnrollment(mockEnrollment);
client.setUserContext(mockUser);
}
Aggregations