diff --git a/Server/CBXCUITestServer.m b/Server/CBXCUITestServer.m index 2bb55c40e..7960c0be4 100644 --- a/Server/CBXCUITestServer.m +++ b/Server/CBXCUITestServer.m @@ -65,6 +65,7 @@ - (instancetype)init_private { [_server setTXTRecordDictionary:capabilities]; [self registerRoutes]; + [self setServerPort]; } return self; } @@ -93,8 +94,6 @@ - (void)start { NSError *error; BOOL serverStarted = NO; - [self setServerPort]; - DDLogDebug(@"Attempting to start the DeviceAgent server"); serverStarted = [self attemptToStartWithError:&error]; diff --git a/TestApp/DeviceAgentUnitTests/CBXUITestServerTest.m b/TestApp/DeviceAgentUnitTests/CBXUITestServerTest.m index 32925cd19..5ad6c20ac 100644 --- a/TestApp/DeviceAgentUnitTests/CBXUITestServerTest.m +++ b/TestApp/DeviceAgentUnitTests/CBXUITestServerTest.m @@ -1,6 +1,8 @@ #import "CBXServerUnitTestUmbrellaHeader.h" #import "CBXCUITestServer.h" +#import "CBXConstants.h" +#import #import "RoutingHTTPServer.h" @interface CBXCUITestServer (CBXTEST) @@ -43,4 +45,8 @@ - (void)testInitPrivateSetsServerAndRegistersRoutes { expect(self.testServer.isFinishedTesting).to.equal(NO); } +-(void)testInitSetsDefaultPort { + expect(self.testServer.server.port).equal(CBX_DEFAULT_SERVER_PORT); +} + @end