Skip to content

Commit d88de4d

Browse files
committed
Fixing the unit tests
1 parent 20e2811 commit d88de4d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Tests/Unit-Tests/NewRelicAgentTests/Handled-Exception-Tests/TestHexUploadPublisher.mm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ - (void)setUp {
5050
auto appLicense = std::make_shared<NewRelic::Hex::Report::ApplicationLicense>("ABCDEF12345");
5151
applicationInfo = std::make_shared<NewRelic::Hex::Report::AppInfo>(appLicense.get(),fbs::Platform_iOS);
5252
attributeValidator = new NewRelic::AttributeValidator([](const char*) {return true;},[](const char*) {return true;},[](const char*) {return true;});
53-
context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator);
53+
auto uploadPublisher = new NewRelic::Hex::HexUploadPublisher(".","AppToken", "1.0", "staging-mobile-collector.staging.com");
54+
context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator,uploadPublisher);
5455
sessionId = std::string("ABSDFWERQWE");
5556
e = std::make_shared<NewRelic::Hex::Report::HandledException>(sessionId,
5657
1,
@@ -70,14 +71,14 @@ - (void)testHexUploaderCreation {
7071
auto appLicense = std::make_shared<NewRelic::Hex::Report::ApplicationLicense>("ABCDEF12345");
7172
std::shared_ptr<NewRelic::Hex::Report::AppInfo> applicationInfo = std::make_shared<NewRelic::Hex::Report::AppInfo>(appLicense.get(),fbs::Platform_iOS);
7273
NewRelic::AttributeValidator* attributeValidator = new NewRelic::AttributeValidator([](const char*) {return true;},[](const char*) {return true;},[](const char*) {return true;});
73-
std::shared_ptr<NewRelic::Hex::HexReportContext> context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator);
74+
auto uploadPublisher = new NewRelic::Hex::HexUploadPublisher(".","AppToken", "1.0", "staging-mobile-collector.staging.com");
75+
std::shared_ptr<NewRelic::Hex::HexReportContext> context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator,uploadPublisher);
7476
std::shared_ptr<NewRelic::Hex::Report::HandledException> exception = std::make_shared<NewRelic::Hex::Report::HandledException>("sessionId",
7577
1,
7678
"The tea is too hot.",
7779
"HotTeaException",
7880
std::vector<std::shared_ptr<NewRelic::Hex::Report::Thread>>());
7981

80-
auto uploadPublisher = new NewRelic::Hex::HexUploadPublisher(".","AppToken", "1.0", "staging-mobile-collector.staging.com");
8182
XCTAssertTrue(uploadPublisher!=NULL);
8283
}
8384

@@ -88,15 +89,15 @@ - (void) testHexUploaderWrapper {
8889
auto appLicense = std::make_shared<NewRelic::Hex::Report::ApplicationLicense>("ABCDEF12345");
8990
std::shared_ptr<NewRelic::Hex::Report::AppInfo> applicationInfo = std::make_shared<NewRelic::Hex::Report::AppInfo>(appLicense.get(),fbs::Platform_iOS);
9091
NewRelic::AttributeValidator* attributeValidator = new NewRelic::AttributeValidator([](const char*) {return true;},[](const char*) {return true;},[](const char*) {return true;});
91-
std::shared_ptr<NewRelic::Hex::HexReportContext> context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator);
92+
auto uploadPublisher = new NewRelic::Hex::TestHexUploadPublisher(".","AppToken", "1.0", "staging-mobile-collector.staging.com");
93+
auto uploader = uploadPublisher->getUploaderImpl();
94+
std::shared_ptr<NewRelic::Hex::HexReportContext> context = std::make_shared<NewRelic::Hex::HexReportContext>(applicationInfo,*attributeValidator,uploadPublisher);
9295
std::shared_ptr<NewRelic::Hex::Report::HandledException> exception = std::make_shared<NewRelic::Hex::Report::HandledException>("sessionId",
9396
1,
9497
"The tea is too hot.",
9598
"HotTeaException",
9699
std::vector<std::shared_ptr<NewRelic::Hex::Report::Thread>>());
97100

98-
auto uploadPublisher = new NewRelic::Hex::TestHexUploadPublisher(".","AppToken", "1.0", "staging-mobile-collector.staging.com");
99-
auto uploader = uploadPublisher->getUploaderImpl();
100101

101102
id mockWrapper = [OCMockObject partialMockForObject:((UploaderImpl*)uploader)->wrapper];
102103

@@ -106,7 +107,7 @@ - (void) testHexUploaderWrapper {
106107

107108
context->finalize();
108109

109-
uploadPublisher->publish(context);
110+
// uploadPublisher->publish(context);
110111

111112
XCTAssertNoThrow([mockWrapper verify]);
112113
}

0 commit comments

Comments
 (0)