@Test
public void finishSignature_invalidFacet() throws Exception {

    expectedException.expectCause(isA(U2fBadInputException.class));
    DeviceRegistration deviceRegistration = new DeviceRegistration(KEY_HANDLE_BASE64, USER_PUBLIC_KEY_SIGN_HEX, ATTESTATION_CERTIFICATE, 0);
    SignRequest request = SignRequest.builder()
        .challenge(SERVER_CHALLENGE_SIGN_BASE64)
        .appId(APP_ID_SIGN)
        .keyHandle(KEY_HANDLE_BASE64)
        .build();
    SignResponse tokenResponse = new SignResponse(CLIENT_DATA_SIGN_BASE64,
            SIGN_RESPONSE_DATA_BASE64, KEY_HANDLE_BASE64);
    SignRequestData requestData = mock(SignRequestData.class);
    when(requestData.getSignRequest(tokenResponse)).thenReturn(request);
    u2f.finishSignature(requestData, tokenResponse, ImmutableList.of(deviceRegistration), ImmutableSet.of("https://wrongfacet.com"));
}