use of org.hyperledger.fabric.sdkintegration.SampleUser in project fabric-sdk-java by hyperledger.
the class HFCAClientIT method testMockEnrollWithMessages.
@Test
public void testMockEnrollWithMessages() throws Exception {
MockHFCAClient mockClient = MockHFCAClient.createNewInstance(testConfig.getIntegrationTestsSampleOrg(TEST_WITH_INTEGRATION_ORG).getCALocation(), testConfig.getIntegrationTestsSampleOrg(TEST_WITH_INTEGRATION_ORG).getCAProperties());
mockClient.setCryptoSuite(crypto);
SampleUser user = getEnrolledUser(TEST_ADMIN_ORG);
mockClient.setHttpPostResponse("{\"success\":true, \"result\":{\"Cert\":\"abc\"}, \"messages\":[{\"code\":123, \"message\":\"test message\"}]}");
mockClient.enroll(user.getName(), user.getEnrollmentSecret());
}
use of org.hyperledger.fabric.sdkintegration.SampleUser in project fabric-sdk-java by hyperledger.
the class HFCAClientIT method testMockReenrollNoCert.
@Ignore
@Test
public void testMockReenrollNoCert() throws Exception {
thrown.expect(EnrollmentException.class);
thrown.expectMessage("failed re-enrollment for user");
MockHFCAClient mockClient = MockHFCAClient.createNewInstance(testConfig.getIntegrationTestsSampleOrg(TEST_WITH_INTEGRATION_ORG).getCALocation(), testConfig.getIntegrationTestsSampleOrg(TEST_WITH_INTEGRATION_ORG).getCAProperties());
mockClient.setCryptoSuite(crypto);
SampleUser user = getEnrolledUser(TEST_ADMIN_ORG);
mockClient.setHttpPostResponse("{\"success\":true}");
mockClient.reenroll(user);
}
Aggregations