summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-05-08 14:52:06 -0400
committerGitHub <noreply@github.com>2020-05-08 14:52:06 -0400
commit88a8824a47fd04c0c1da0ed1f7e468a72c90d82d (patch)
treeb3b748bae9d8f1aa428c320c88200ef49e0206ca
parentc34d76487b50ce839de7773a98d9fbede89bce02 (diff)
parent718e89811723a54aa0909dc024adb40977474c10 (diff)
downloadsdl_ios-88a8824a47fd04c0c1da0ed1f7e468a72c90d82d.tar.gz
Merge pull request #1655 from smartdevicelink/bugfix/issue_1653_add_security_manager_sec_transp_tests
Add secondary transport security manager unit tests
-rw-r--r--SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m b/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
index 1ca8a23c7..b110af0f6 100644
--- a/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
+++ b/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
@@ -521,6 +521,7 @@ describe(@"the secondary transport manager ", ^{
testPrimaryProtocol = [[SDLProtocol alloc] init];
testPrimaryTransport = [[SDLTCPTransport alloc] init];
testPrimaryProtocol.transport = testPrimaryTransport;
+ testPrimaryProtocol.securityManager = OCMClassMock([SDLFakeSecurityManager class]);
dispatch_sync(testStateMachineQueue, ^{
[manager startWithPrimaryProtocol:testPrimaryProtocol];
@@ -537,6 +538,7 @@ describe(@"the secondary transport manager ", ^{
it(@"should stay in state Configured", ^{
expect(manager.stateMachine.currentState).to(equal(SDLSecondaryTransportStateConfigured));
expect(manager.currentHMILevel).to(beNil());
+ expect(manager.secondaryProtocol.securityManager).to(beNil());
OCMVerifyAll(testStreamingProtocolDelegate);
});
@@ -550,6 +552,7 @@ describe(@"the secondary transport manager ", ^{
it(@"should transition to Connecting state", ^{
expect(manager.stateMachine.currentState).to(equal(SDLSecondaryTransportStateConnecting));
expect(manager.currentHMILevel).to(equal(SDLHMILevelFull));
+ expect(manager.secondaryProtocol.securityManager).to(equal(testPrimaryProtocol.securityManager));
OCMVerifyAll(testStreamingProtocolDelegate);
});
@@ -601,6 +604,7 @@ describe(@"the secondary transport manager ", ^{
testTransportEventUpdatePayload = [[SDLControlFramePayloadTransportEventUpdate alloc] initWithTcpIpAddress:testTcpIpAddress tcpPort:testTcpPort];
testTransportEventUpdateMessage = [[SDLV2ProtocolMessage alloc] initWithHeader:testTransportEventUpdateHeader andPayload:testTransportEventUpdatePayload.data];
+ testPrimaryProtocol.securityManager = OCMClassMock([SDLFakeSecurityManager class]);
[testPrimaryProtocol handleBytesFromTransport:testTransportEventUpdateMessage.data];
[NSThread sleepForTimeInterval:0.1];
@@ -610,6 +614,7 @@ describe(@"the secondary transport manager ", ^{
it(@"should stay in Configured state", ^{
expect(manager.stateMachine.currentState).to(equal(SDLSecondaryTransportStateConfigured));
expect(manager.currentHMILevel).to(beNil());
+ expect(manager.secondaryProtocol.securityManager).to(beNil());
OCMVerifyAll(testStreamingProtocolDelegate);
});
@@ -623,6 +628,7 @@ describe(@"the secondary transport manager ", ^{
it(@"should transition to Connecting", ^{
expect(manager.stateMachine.currentState).to(equal(SDLSecondaryTransportStateConnecting));
expect(manager.currentHMILevel).to(equal(SDLHMILevelFull));
+ expect(manager.secondaryProtocol.securityManager).to(equal(testPrimaryProtocol.securityManager));
OCMVerifyAll(testStreamingProtocolDelegate);
});