use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockUser in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadEnrollmentNull.
@Test(expected = InvalidArgumentException.class)
public void testBadEnrollmentNull() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(USER_NAME, USER_MSP_ID);
mockUser.setEnrollment(null);
client.setUserContext(mockUser);
}
use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockUser in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadUserMSPIDEmpty.
@Test(expected = InvalidArgumentException.class)
public void testBadUserMSPIDEmpty() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(USER_NAME, "");
client.setUserContext(mockUser);
}
use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockUser in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadUserNameEmpty.
@Test(expected = InvalidArgumentException.class)
public void testBadUserNameEmpty() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser("", USER_MSP_ID);
client.setUserContext(mockUser);
}
use of org.hyperledger.fabric.sdk.testutils.TestUtils.MockUser 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.MockUser in project fabric-sdk-java by hyperledger.
the class ClientTest method testBadUserNameNull.
@Test(expected = InvalidArgumentException.class)
public void testBadUserNameNull() throws Exception {
HFClient client = HFClient.createNewInstance();
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
MockUser mockUser = TestUtils.getMockUser(null, USER_MSP_ID);
client.setUserContext(mockUser);
}
Aggregations