                 "subscriptions": [:],
                 "other_purchases": [:]
             ]])
-        expect(customerInfo!.managementURL).toNot(beNil())
-        expect(customerInfo!.managementURL!.absoluteString) == "https://apple.com/manage_subscription"
-    }
-
-    func testManagementURLIsNullWithInvalidURL() {
-        var customerInfo = CustomerInfo(testData: [
+        expect(customerInfo.managementURL?.absoluteString) == "https://apple.com/manage_subscription"
+    }
+
+    func testManagementURLIsNullWithInvalidURL() throws {
+        var customerInfo = try CustomerInfo(data: [
             "request_date": "2019-08-16T10:30:42Z",
             "subscriber": [
                 "management_url": "",

                ]
            ]
        ] as [String: Any]
        let customerInfoWithoutRequestData = CustomerInfo(testData: response)
        let purchaseDate = customerInfoWithoutRequestData!.purchaseDate(forEntitlement: "pro")
        expect(purchaseDate).to(beNil())
    }

    func testEmptyInfosEqual() {
        let info1 = CustomerInfo(testData: [
            "request_date": "2019-08-16T10:30:42Z",
            "subscriber": [
                "first_seen": "2019-07-17T00:05:54Z",
                "original_app_user_id": "",
                "subscriptions": [:],
                "other_purchases": [:]
            ]])
        let info2 = CustomerInfo(testData: [
            "request_date": "2019-08-16T10:30:42Z",
            "subscriber": [
                "first_seen": "2019-07-17T00:05:54Z",
                "original_app_user_id": "",
                "subscriptions": [:],
                "other_purchases": [:]
            ]])
        expect(info1).to(equal(info2))
    }

    func testDifferentFetchDatesStillEqual() {
        let info1 = CustomerInfo(testData: [
            "request_date": "2019-08-16T10:30:42Z",
            "subscriber": [
                "first_seen": "2019-07-17T00:05:54Z",
                "original_app_user_id": "",
                "subscriptions": [:],
                "other_purchases": [:]
            ]])
        let info2 = CustomerInfo(testData: [
            "request_date": "2018-11-19T02:40:36Z",
            "subscriber": [
                "first_seen": "2019-07-17T00:05:54Z",

                "subscriptions": [:],
                "other_purchases": [:]
            ]])
        expect(info1) == info2
    }

    func testDifferentActiveEntitlementsNotEqual() throws {
        let info1 = try CustomerInfo(data: [
            "request_date": "2018-12-20T02:40:36Z",
            "subscriber": [
                "first_seen": "2019-07-17T00:05:54Z",
