      default-services
      (jruby-service-test-config 1)
      (let [service (app/get-service app :JRubyPuppetService)
-           production-before-first-update
+           production-cache-id-before-first-update
            (jruby-protocol/get-environment-class-info-cache-generation-id!
             service
             "production")]

         (is (= "1234test" (jruby-protocol/get-environment-class-info-tag
                            service
                            "test"))))
       (let [production-first-update
             (jruby-protocol/get-environment-class-info-cache-generation-id!
              service
              "production")
             test-first-update
             (jruby-protocol/get-environment-class-info-cache-generation-id!
              service
              "test")]
         (testing "when environment info reset in the cache"
           (is (not (nil? production-first-update)))
           (is (not (nil? test-first-update)))
           (jruby-protocol/set-environment-class-info-tag!
            service
            "production"
            "5678prod"
            production-first-update)
           (is (= "5678prod" (jruby-protocol/get-environment-class-info-tag
                              service
                              "production")))
           (is (= "1234test" (jruby-protocol/get-environment-class-info-tag
                              service
                              "test")))
           (is (= test-first-update
                  (jruby-protocol/get-environment-class-info-cache-generation-id!
                   service
                   "test")))
           (testing "and environment expired between get and corresponding set"
             (let [production-second-update
                   (jruby-protocol/get-environment-class-info-cache-generation-id!
                    service
                    "production")
                   _ (jruby-protocol/mark-environment-expired! service
                                                               "production")
                   production-third-update
                   (jruby-protocol/get-environment-class-info-cache-generation-id!
                    service
                    "production")]
               (is (not= production-first-update production-second-update))
               (jruby-protocol/set-environment-class-info-tag!
                service
                "production"
                "89abprod"
                production-second-update)
               (is (= nil (jruby-protocol/get-environment-class-info-tag
                           service
                           "production")))
               (is (= production-third-update
                      (jruby-protocol/get-environment-class-info-cache-generation-id!
                       service
                       "production"))))))
         (testing "when an individual environment is marked expired"
           (jruby-protocol/mark-environment-expired! service "production")
           (is (nil? (jruby-protocol/get-environment-class-info-tag
                      service
                      "production")))
           (is (not= production-first-update
                     (jruby-protocol/get-environment-class-info-cache-generation-id!
                      service
                      "production")))
           (is (= "1234test" (jruby-protocol/get-environment-class-info-tag
                              service
                              "test")))
           (is (= test-first-update
                  (jruby-protocol/get-environment-class-info-cache-generation-id!
                   service
                   "test"))))
         (testing "when all environments are marked expired"
           (let [production-update
                 (jruby-protocol/get-environment-class-info-cache-generation-id!
                  service
                  "production")]

              service
              "staging"
              "1234staging"
              staging-cache-id-before-marked-expired)
             (is (= nil (jruby-protocol/get-environment-class-info-tag
                         service
                         "staging"))
                 (str "Tag should not have been changed by the prior set "
                      "since the environment was marked expired after the "
                      "`staging-cache-id-before-marked-expired` was read"))
             (is (= staging-cache-id-after-marked-expired
                    (jruby-protocol/get-environment-class-info-cache-generation-id!
                     service
                     "staging"))
                 (str "Cache id should not have been changed by the prior "
                      "set since the environment was marked expired after the "
                      "`staging-cache-id-before-marked-expired` was "
                      "read")))))))))
