FRAPushMechanismFactoryTests.m revision 7c51d54f23c5581d2cf894f9eafb9798e3febd22
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni/*
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * The contents of this file are subject to the terms of the Common Development and
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * Distribution License (the License). You may not use this file except in compliance with the
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * License.
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni *
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * specific language governing permission and limitations under the License.
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni *
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * When distributing Covered Software, include this CDDL Header Notice in each file and include
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * Header, with the fields enclosed by brackets [] replaced by your own identifying
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * information: "Portions copyright [year] [name of copyright owner]".
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni *
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni * Copyright 2015-2016 ForgeRock AS.
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni */
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#import <XCTest/XCTest.h>
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#import <OCMock/OCMock.h>
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#import "FRAError.h"
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni#import "FRAidentity.h"
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#import "FRAMessageUtils.h"
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni#import "FRAPushMechanism.h"
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni#import "FRAPushMechanismFactory.h"
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantonistatic NSInteger const RESPOND_WITH_ENDPOINT_HANDLER_CALLBACK_PARAMETER_INDEX = 7;
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantonistatic NSString * const DEVICE_ID = @"device id";
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni@interface FRAPushMechanismFactoryTests : XCTestCase
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni@end
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni@implementation FRAPushMechanismFactoryTests {
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni FRAIdentityModel *identityModel;
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni FRAPushMechanismFactory *factory;
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni id mockMessageUtils;
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni id mockGateway;
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni}
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni- (void)setUp {
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni [super setUp];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni mockMessageUtils = OCMClassMock([FRAMessageUtils class]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni mockGateway = OCMClassMock([FRANotificationGateway class]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub(((FRANotificationGateway *)mockGateway).deviceToken).andReturn(DEVICE_ID);
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni identityModel = [[FRAIdentityModel alloc] initWithDatabase:nil sqlDatabase:nil];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni factory = [[FRAPushMechanismFactory alloc] initWithGateway:mockGateway];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni}
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni- (void)tearDown {
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni [mockMessageUtils stopMocking];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni [mockGateway stopMocking];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni [super tearDown];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni}
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni- (void)testParseSetsImageUrlOnIdentity {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni base64Secret:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni messageId:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni loadBalancerCookieData:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni data:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni handler:[OCMArg any]]);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:nil];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni FRAIdentity *identity = mechanism.parent;
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni XCTAssertEqualObjects([identity.image absoluteString], @"http://seattlewriter.com/wp-content/uploads/2013/01/weight-watchers-small.gif");
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni}
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni- (void)testMechanismIsRemovedIfFailedToRespond {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni base64Secret:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni messageId:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni loadBalancerCookieData:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni data:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni handler:[OCMArg any]])
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni .andDo(^(NSInvocation *invocation) {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni void (^callback)(NSInteger, NSError *);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni [invocation getArgument:&callback atIndex:RESPOND_WITH_ENDPOINT_HANDLER_CALLBACK_PARAMETER_INDEX];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni callback(404, nil);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni });
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:nil];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni XCTAssertNil([identityModel mechanismWithId:mechanism.mechanismUID]);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni}
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni- (void)testIdentityIsRemovedIfFailedToRespondAndIdentityHasNoOtherMechanism {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni base64Secret:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni messageId:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni loadBalancerCookieData:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni data:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni handler:[OCMArg any]])
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni .andDo(^(NSInvocation *invocation) {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni void (^callback)(NSInteger, NSError *);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni [invocation getArgument:&callback atIndex:RESPOND_WITH_ENDPOINT_HANDLER_CALLBACK_PARAMETER_INDEX];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni callback(404, nil);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni });
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:nil];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni XCTAssertNil([identityModel identityWithIssuer:@"ForgeRock" accountName:@"demo3"]);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni}
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni- (void)testIdentityIsNotRemovedIfFailedToRespondButIdentityHasOtherMechanisms {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni OCMExpect([mockMessageUtils respondWithEndpoint:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni base64Secret:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni messageId:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni loadBalancerCookieData:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni data:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni handler:[OCMArg any]]);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni NSURL *successfulQr = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dGhlbGVnZW5kb2ZsdW5h=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=0efccfa7-c4ac-4fa4-99ef-b425027f03f7&issuer=Rm9yZ2Vyb2Nr"];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [factory buildMechanism:successfulQr database:nil identityModel:identityModel handler:nil error:nil];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni OCMExpect([mockMessageUtils respondWithEndpoint:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni base64Secret:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni messageId:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni loadBalancerCookieData:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni data:[OCMArg any]
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni handler:[OCMArg any]])
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni .andDo(^(NSInvocation *invocation) {
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni void (^callback)(NSInteger, NSError *);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni [invocation getArgument:&callback atIndex:RESPOND_WITH_ENDPOINT_HANDLER_CALLBACK_PARAMETER_INDEX];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni callback(404, nil);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni });
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni NSURL *unsuccessfulQr = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [factory buildMechanism:unsuccessfulQr database:nil identityModel:identityModel handler:nil error:nil];
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni XCTAssertNotNil([identityModel identityWithIssuer:@"Forgerock" accountName:@"demo3"]);
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni}
caa9e77dc369fea8df9ae2c598d3c83b7214c1cfDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni- (void)testBuildMechanismReturnsNilIfDuplicate {
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni base64Secret:[OCMArg any]
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni messageId:[OCMArg any]
5d37db6a3aca50ba14cba8909d3ae44f7d43e407Ken Stubbings loadBalancerCookieData:[OCMArg any]
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni data:[OCMArg any]
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:nil];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAMechanism *duplicateMechanism = [factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni XCTAssertNil(duplicateMechanism);
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni XCTAssertEqual(error.code, FRADuplicateMechanism);
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni}
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoDeviceId {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni id gateway = OCMClassMock([FRANotificationGateway class]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub(((FRANotificationGateway *)gateway).deviceToken).andReturn(@"");
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni FRAPushMechanismFactory *mechanismFactory = [[FRAPushMechanismFactory alloc] initWithGateway:gateway];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAMechanism *mechanism = [mechanismFactory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingDeviceId);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoSecret {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMQ==&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoAuthEndpoint {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoRegEndpoint {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoMessageId {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoChallenge {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni- (void)testBuildMechanismReturnsNilIfNoIssuer {
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni OCMStub([mockMessageUtils respondWithEndpoint:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni base64Secret:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni messageId:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni loadBalancerCookieData:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni data:[OCMArg any]
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni handler:[OCMArg any]]);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer="];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni NSError *error;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni FRAPushMechanism *mechanism = (FRAPushMechanism *)[factory buildMechanism:qrUrl database:nil identityModel:identityModel handler:nil error:&error];
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertNil(mechanism);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni XCTAssertEqual(error.code, FRAMissingMechanismInfo);
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni}
33f578498e5bdaf445a4f509ac419f0a23148f61Diego Colantoni
78c07714ec1113f7f21c75b818f2bf6a7021618aDiego Colantoni@end