use of com.amazonaws.services.cognitoidentityprovider.model.UnexpectedLambdaException in project aws-sdk-android by aws-amplify.
the class CognitoIdentityProviderUserPoolTest method signUpInBackgroundUnexpectedLambdaException.
// Sign-up failure
@Test
public void signUpInBackgroundUnexpectedLambdaException() throws Exception {
testPool = new CognitoUserPool(appContext, TEST_USER_POOL, TEST_CLIENT_ID, TEST_CLIENT_SECRET, mockCSIClient);
UnexpectedLambdaException exception = new UnexpectedLambdaException("registration failed");
doThrow(exception).when(mockCSIClient).signUp(any(SignUpRequest.class));
testPool.signUpInBackground(TEST_USER_NAME, "null", TEST_IN_USER_ATTRIBUTES_LIST, TEST_IN_VALIDATION_DATA, new SignUpHandler() {
@Override
public void onSuccess(CognitoUser user, SignUpResult signUpResult) {
assertNotNull(user);
assertEquals(TEST_USER_NAME, user.getUserId());
}
@Override
public void onFailure(Exception exception) {
assertNotNull(exception);
assertTrue(exception instanceof UnexpectedLambdaException);
}
});
}
use of com.amazonaws.services.cognitoidentityprovider.model.UnexpectedLambdaException in project aws-sdk-android by aws-amplify.
the class UnexpectedLambdaExceptionUnmarshaller method unmarshall.
@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
UnexpectedLambdaException e = (UnexpectedLambdaException) super.unmarshall(error);
e.setErrorCode("UnexpectedLambdaException");
return e;
}
Aggregations