@Test
public void finishRegistrationShouldDetectIncorrectAppId() throws Exception {

    expectedException.expectCause(isA(U2fBadInputException.class));
    RegisterRequest registerRequest = new RegisterRequest(SERVER_CHALLENGE_REGISTER_BASE64, APP_ID_ENROLL);
    DeviceRegistration response = u2f.finishRegistration(
        registerRequest,
        new RegisterResponse(
            TestVectors.REGISTRATION_DATA_WITH_DIFFERENT_APP_ID_BASE64,
            CLIENT_DATA_REGISTRATION_BASE64
        )
    );
    fail("finishRegistration did not detect incorrect app ID");
}