FRANotificationTest.m revision 6a2ae9c7fb4d2c40d75cab0edaf940f22c18224f
2cacab200fb387e290386593d9b2fca2e7beef33csovant/*
2cacab200fb387e290386593d9b2fca2e7beef33csovant * The contents of this file are subject to the terms of the Common Development and
2cacab200fb387e290386593d9b2fca2e7beef33csovant * Distribution License (the License). You may not use this file except in compliance with the
2cacab200fb387e290386593d9b2fca2e7beef33csovant * License.
2cacab200fb387e290386593d9b2fca2e7beef33csovant *
2cacab200fb387e290386593d9b2fca2e7beef33csovant * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2cacab200fb387e290386593d9b2fca2e7beef33csovant * specific language governing permission and limitations under the License.
2cacab200fb387e290386593d9b2fca2e7beef33csovant *
2cacab200fb387e290386593d9b2fca2e7beef33csovant * When distributing Covered Software, include this CDDL Header Notice in each file and include
2cacab200fb387e290386593d9b2fca2e7beef33csovant * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
2cacab200fb387e290386593d9b2fca2e7beef33csovant * Header, with the fields enclosed by brackets [] replaced by your own identifying
2cacab200fb387e290386593d9b2fca2e7beef33csovant * information: "Portions copyright [year] [name of copyright owner]".
2cacab200fb387e290386593d9b2fca2e7beef33csovant *
2cacab200fb387e290386593d9b2fca2e7beef33csovant * Copyright 2016 ForgeRock AS.
2cacab200fb387e290386593d9b2fca2e7beef33csovant */
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import <OCMock/OCMock.h>
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import <XCTest/XCTest.h>
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import "FRAIdentityDatabase.h"
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import "FRAIdentityDatabaseSQLiteOperations.h"
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import "FRAIdentityModel.h"
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import "FRAMessageUtils.h"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant#import "FRANotification.h"
2cacab200fb387e290386593d9b2fca2e7beef33csovant#import "FRAPushMechanism.h"
2cacab200fb387e290386593d9b2fca2e7beef33csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant@interface FRANotificationTest : XCTestCase
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant@end
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant@implementation FRANotificationTest {
2cacab200fb387e290386593d9b2fca2e7beef33csovant id mockSqlOperations;
2cacab200fb387e290386593d9b2fca2e7beef33csovant id mockIdentityModel;
2cacab200fb387e290386593d9b2fca2e7beef33csovant id databaseObserverMock;
2cacab200fb387e290386593d9b2fca2e7beef33csovant FRAIdentityDatabase *database;
2cacab200fb387e290386593d9b2fca2e7beef33csovant FRANotification* notification;
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant id messageUtilsMock;
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant FRAPushMechanism *mechanism;
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)setUp {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [super setUp];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant mockSqlOperations = OCMClassMock([FRAIdentityDatabaseSQLiteOperations class]);
2cacab200fb387e290386593d9b2fca2e7beef33csovant mockIdentityModel = OCMClassMock([FRAIdentityModel class]);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant database = [[FRAIdentityDatabase alloc] initWithSqlOperations:mockSqlOperations];
2cacab200fb387e290386593d9b2fca2e7beef33csovant NSTimeInterval timeToLive = 120.0;
2cacab200fb387e290386593d9b2fca2e7beef33csovant mechanism = [[FRAPushMechanism alloc] initWithDatabase:database identityModel:mockIdentityModel authEndpoint:@"http://service.endpoint" secret:@"secret"];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant notification = [[FRANotification alloc] initWithDatabase:database identityModel:mockIdentityModel messageId:@"messageId" challenge:@"challenge" timeReceived:[NSDate date] timeToLive:timeToLive loadBalancerCookieData:@"amlbcookie=03"];
2cacab200fb387e290386593d9b2fca2e7beef33csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations *)mockSqlOperations insertNotification:notification error:nil]).andReturn(YES);
2cacab200fb387e290386593d9b2fca2e7beef33csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations *)mockSqlOperations updateNotification:notification error:nil]).andReturn(YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant databaseObserverMock = OCMObserverMock();
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant messageUtilsMock = OCMClassMock([FRAMessageUtils class]);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [notification setParent:mechanism];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)tearDown {
2cacab200fb387e290386593d9b2fca2e7beef33csovant [mockSqlOperations stopMocking];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [messageUtilsMock stopMocking];
2cacab200fb387e290386593d9b2fca2e7beef33csovant [super tearDown];
2cacab200fb387e290386593d9b2fca2e7beef33csovant}
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant- (void)testInitialStateOfNotification {
2cacab200fb387e290386593d9b2fca2e7beef33csovant // Given
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([notification isPending], YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([notification isApproved], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([notification isDenied], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([notification isExpired], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)testShouldSetTimeExpired {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
2cacab200fb387e290386593d9b2fca2e7beef33csovant NSDate *timeReceived = [NSDate date];
2cacab200fb387e290386593d9b2fca2e7beef33csovant NSTimeInterval timeToLive = 120.0;
2cacab200fb387e290386593d9b2fca2e7beef33csovant FRANotification *expiringNotification = [[FRANotification alloc] initWithDatabase:database identityModel:mockIdentityModel messageId:@"messageId" challenge:@"challenge" timeReceived:timeReceived timeToLive:timeToLive loadBalancerCookieData:@"amlbcookie=03"];
2cacab200fb387e290386593d9b2fca2e7beef33csovant
f297f739a5d87cf4c8cbb21bed39a54e7c5804f5csovant // When
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant // Then
2cacab200fb387e290386593d9b2fca2e7beef33csovant XCTAssertEqualObjects([expiringNotification timeExpired], [timeReceived dateByAddingTimeInterval:timeToLive]);
2cacab200fb387e290386593d9b2fca2e7beef33csovant}
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant- (void)testShouldApproveNotification {
2cacab200fb387e290386593d9b2fca2e7beef33csovant // Given
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant // When
2cacab200fb387e290386593d9b2fca2e7beef33csovant [notification approveWithHandler:nil error:nil];
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant // Then
2cacab200fb387e290386593d9b2fca2e7beef33csovant XCTAssertEqual([notification isPending], NO);
2cacab200fb387e290386593d9b2fca2e7beef33csovant XCTAssertEqual([notification isApproved], YES);
2cacab200fb387e290386593d9b2fca2e7beef33csovant XCTAssertEqual([notification isDenied], NO);
2cacab200fb387e290386593d9b2fca2e7beef33csovant}
2cacab200fb387e290386593d9b2fca2e7beef33csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)testApproveNotificationSendsMessageToService {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [database insertNotification:notification error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMExpect([messageUtilsMock respondWithEndpoint:@"http://service.endpoint"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant base64Secret:@"secret"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant messageId:@"messageId"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant loadBalancerCookieData:@"amlbcookie=03"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant data:@{@"response":[FRAMessageUtils generateChallengeResponse:@"challenge"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant secret:@"secret"]}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant handler:[OCMArg any]]);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [notification approveWithHandler:nil error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMVerifyAll(messageUtilsMock);
2cacab200fb387e290386593d9b2fca2e7beef33csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant- (void)testShouldDenyNotification {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [notification denyWithHandler:nil error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift XCTAssertEqual([notification isPending], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([notification isApproved], NO);
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift XCTAssertEqual([notification isDenied], YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant- (void)testDenyNotificationSendsMessageToService {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [database insertNotification:notification error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant NSDictionary *expectedData = @{
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant @"response":[FRAMessageUtils generateChallengeResponse:@"challenge" secret:@"secret"],
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant @"deny": @YES
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift };
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMExpect([messageUtilsMock respondWithEndpoint:@"http://service.endpoint"
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift base64Secret:@"secret"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant messageId:@"messageId"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant loadBalancerCookieData:@"amlbcookie=03"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant data:expectedData
2cacab200fb387e290386593d9b2fca2e7beef33csovant handler:[OCMArg any]]);
2cacab200fb387e290386593d9b2fca2e7beef33csovant
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift // When
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift [notification denyWithHandler:nil error:nil];
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift // Then
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift OCMVerifyAll(messageUtilsMock);
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift}
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift- (void)testSavedNotificationAutomaticallySavesItselfToDatabaseWhenApproved {
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift // Given
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations insertNotification:notification error:nil]).andReturn(YES);
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift [database insertNotification:notification error:nil];
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations updateNotification:notification error:nil]).andReturn(YES);
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift OCMStub([messageUtilsMock respondWithEndpoint:@"http://service.endpoint"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant base64Secret:@"secret"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant messageId:@"messageId"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant loadBalancerCookieData:@"amlbcookie=03"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant data:@{@"response":[FRAMessageUtils generateChallengeResponse:@"challenge"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant secret:@"secret"]}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant handler:[OCMArg any]]);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant BOOL notificationApproved = [notification approveWithHandler:nil error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift XCTAssertTrue(notificationApproved);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)testSavedNotificationAutomaticallySavesItselfToDatabaseWhenDenied {
2cacab200fb387e290386593d9b2fca2e7beef33csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations insertNotification:notification error:nil]).andReturn(YES);
2cacab200fb387e290386593d9b2fca2e7beef33csovant [database insertNotification:notification error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations updateNotification:notification error:nil]).andReturn(YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // When
2cacab200fb387e290386593d9b2fca2e7beef33csovant BOOL notificationDenied = [notification denyWithHandler:nil error:nil];
2cacab200fb387e290386593d9b2fca2e7beef33csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
2cacab200fb387e290386593d9b2fca2e7beef33csovant XCTAssertTrue(notificationDenied);
2cacab200fb387e290386593d9b2fca2e7beef33csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant- (void)testBroadcastsOneChangeNotificationWhenNotificationUpdateIsAutomaticallySavedToDatabase {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
2cacab200fb387e290386593d9b2fca2e7beef33csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations insertNotification:notification error:nil]).andReturn(YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [database insertNotification:notification error:nil];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMStub([(FRAIdentityDatabaseSQLiteOperations*)mockSqlOperations updateNotification:notification error:nil]).andReturn(YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [[NSNotificationCenter defaultCenter] addMockObserver:databaseObserverMock name:FRAIdentityDatabaseChangedNotification object:database];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant [[databaseObserverMock expect] notificationWithName:FRAIdentityDatabaseChangedNotification object:database userInfo:[OCMArg any]];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMStub([messageUtilsMock respondWithEndpoint:@"http://service.endpoint"
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift base64Secret:@"secret"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant messageId:@"messageId"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant loadBalancerCookieData:@"amlbcookie=03"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant data:@{@"response":[FRAMessageUtils generateChallengeResponse:@"challenge"
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant secret:@"secret"]}
2cacab200fb387e290386593d9b2fca2e7beef33csovant handler:[OCMArg any]]);
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift // When
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift BOOL notificationApproved = [notification approveWithHandler:nil error:nil];
62ecec3a82a8b838ee76c1f6610902d8fd7015cbmatthew_swift
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertTrue(notificationApproved);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant OCMVerifyAll(databaseObserverMock);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)testIsExpiredReturnsYesIfNotificationHasExpired {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant FRANotification *expiredNotification = [[FRANotification alloc] initWithDatabase:database identityModel:mockIdentityModel messageId:@"messageId" challenge:@"challenge" timeReceived:[NSDate date] timeToLive:-10.0 loadBalancerCookieData:@"amlbcookie=03"];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isExpired], YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isPending], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isApproved], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isDenied], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant- (void)testIsExpiredReturnsNoIfNotificationHasNotExpired {
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Given
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant FRANotification *expiredNotification = [[FRANotification alloc] initWithDatabase:database identityModel:mockIdentityModel messageId:@"messageId" challenge:@"challenge" timeReceived:[NSDate date] timeToLive:120.0 loadBalancerCookieData:@"amlbcookie=03"];
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant // When
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant // Then
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isExpired], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isPending], YES);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isApproved], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant XCTAssertEqual([expiredNotification isDenied], NO);
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant}
2cacab200fb387e290386593d9b2fca2e7beef33csovant
2cacab200fb387e290386593d9b2fca2e7beef33csovant@end
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant
23f633e1b8cc53fdac740eca4ab7e0341890bba2csovant