                    :user/id user-id
                    :gis-user/password "password123"
                    :gis-user/username "username123"}]
-                 (db-admin/generate-commands state)))
+                 (generate-commands events)))
 
           (testing "> GIS user is present"
-            (let [events (conj events user-is-present-event)
-                  state (apply-events events)
-                  expected (merge expected {::db-admin/pending-gis-users {}})]
-              (is (= expected state))
+            (let [events (conj events user-is-present-event)]
               (is (= [{:command/type :db-admin.command/migrate-tenant-schema
                        :congregation/id cong-id
                        :congregation/schema-name "cong1_schema"}]
-                     (db-admin/generate-commands state)))))
+                     (generate-commands events)))))
 
           (testing "> GIS user is absent (undesired)"
-            (let [events (conj events user-is-absent-event)
-                  state (apply-events events)]
-              (is (= expected state)
-                  "no change")
+            (let [events (conj events user-is-absent-event)]
               (is (= [{:command/type :db-admin.command/migrate-tenant-schema
                        :congregation/id cong-id
                        :congregation/schema-name "cong1_schema"}

                       :user/id user-id
                       :gis-user/password "password123"
                       :gis-user/username "username123"}]
                     (db-admin/generate-commands state)))))

          (testing "> GIS user deleted"
            (let [events (conj events user-deleted-event)
                  state (apply-events events)
                  expected (merge expected
                                  {::db-admin/pending-gis-users
                                   {[cong-id user-id] {::db-admin/desired-state :absent
                                                       :gis-user/username "username123"
                                                       :congregation/schema-name "cong1_schema"}}})]
              (is (= expected state))
              (is (= [{:command/type :db-admin.command/migrate-tenant-schema
                       :congregation/id cong-id
                       :congregation/schema-name "cong1_schema"}

                           :congregation/schema-name "cong1_schema"
                           :user/id user-id
                           :gis-user/username "username123"}]
                         (generate-commands events)))))

              (testing "> GIS user is absent"
                (let [events (conj events user-is-absent-event)]
                  (is (= [{:command/type :db-admin.command/migrate-tenant-schema
                           :congregation/id cong-id
                           :congregation/schema-name "cong1_schema"}]
                         (generate-commands events))))))))))))

(deftest process-test
  (let [spy (spy/spy)
