         let expectedPaymentMethods = [STPFixtures.paymentMethod()]
 
         stubRetrieveCustomers(key: customerKey, returningCustomerJSON: expectedCustomerJSON, expectedCount: 1, apiClient: apiClient)
-        
+        stubListPaymentMethods(key: customerKey, paymentMethodJSONs: [], expectedCount: 1, apiClient: apiClient)
+
         let exp = expectation(description: "payment method detach")
         // We're detaching 2 payment methods:
         exp.expectedFulfillmentCount = 2

        // - when the context is initialized,
        // - when sut.retrieveCustomer is called below, as the cached customer has been cleared.
        stubRetrieveCustomers(key: customerKey, returningCustomerJSON: expectedCustomerJSON, expectedCount: 2, apiClient: apiClient)
        let ekm = MockEphemeralKeyManager(key: customerKey, error: nil)
        let sut = STPCustomerContext(keyManager: ekm, apiClient: apiClient)
        // Give the mocked API request a little time to complete and cache the customer, then reset and check cache

        let expectedPaymentMethods = [STPFixtures.paymentMethod()]

        stubRetrieveCustomers(key: customerKey, returningCustomerJSON: expectedCustomerJSON, expectedCount: 1, apiClient: apiClient)
        stubListPaymentMethods(key: customerKey, paymentMethodJSONs: [], expectedCount: 1, apiClient: apiClient)

        let exp = expectation(description: "payment method attach")
        // We're attaching 2 payment methods:
        exp.expectedFulfillmentCount = 2
