           {:onyx.core/compiled-norm-fcs compiled} nil nil flow-conditions downstream)]
      (is (= (into #{} (mapcat :flow/to flow-conditions)) (:flow results)))
      (is (nil? (:action results))))))
-
-(def predicates
-  {true ::true-red
-   false ::false-pred})
-
-(defn flow-condition-gen [from-task]
-  (gen/hash-map
-   :flow/from (gen/return from-task)
-   :flow/to (gen/one-of [(gen/return :all) (gen/return :none) (gen/vector gen/keyword)])
-   :flow/exclude-keys (gen/vector gen/keyword)))
-
-(defn true-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return ::true-pred)
-           true-gen (gen/hash-map :flow/predicate g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn false-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return ::false-pred)
-           true-gen (gen/hash-map :flow/predicate g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn short-circuit-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/return true)
-           true-gen (gen/hash-map :flow/short-circuit? g)]
-       (gen/fmap #(merge v %) true-gen)))))
-
-(defn exception-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/hash-map
-              :flow/thrown-exception? (gen/return true)
-              :flow/short-circuit? (gen/return true)
-              :flow/post-transform (gen/one-of
-                                    [(gen/return nil)
-                                     (gen/return ::post-transform)]))]
-       (gen/fmap #(merge v %) g)))))
-
-(defn retry-flow-condition-gen [base-gen]
-  (gen/bind
-   base-gen
-   (fn [v]
-     (let [g (gen/hash-map :flow/action (gen/return :retry))]
-       (gen/fmap #(merge v %) g)))))
-
-
-(clojure.pprint/pprint
- (gen/sample
-  (->> :A
-       (flow-condition-gen)
-       (true-flow-condition-gen)
-       (exception-flow-condition-gen)
-       (retry-flow-condition-gen))))
 
 
 

  (checking
   "The matching flow condition limits the downstream selection"
   (times 50)
   [[downstream flow-to] gen-tasks-and-subset]
   (let [task :a
         fcs [{:flow/from task
               :flow/to flow-to
               :flow/predicate ::true-pred}]
         compiled (c/compile-fc-norms fcs task)
         results
         (t/route-data
          {:onyx.core/compiled-norm-fcs compiled} nil nil fcs downstream)]
     (is (= (into #{} flow-to) (:flow results)))
     (is (nil? (:action results))))))

(deftest conj-downstream-tasks-together


(def false-pred (constantly false))

(def predicates
  {true ::true-red
   false ::false-pred})

(defn flow-condition-gen [from-task]
  (gen/hash-map
   :flow/from (gen/return from-task)
   :flow/exclude-keys (gen/vector gen/keyword)))

(defn flow-to-all-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map :flow/to (gen/return :all))]
       (gen/fmap #(merge v %) g)))))

(defn flow-to-none-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map :flow/to (gen/return :none))]
       (gen/fmap #(merge v %) g)))))

(defn flow-to-tasks-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map :flow/to (gen/vector gen/keyword))]
       (gen/fmap #(merge v %) g)))))

(defn true-flow-condition-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/return ::true-pred)
           true-gen (gen/hash-map :flow/predicate g)]
       (gen/fmap #(merge v %) true-gen)))))

(defn false-flow-condition-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/return ::false-pred)
           false-gen (gen/hash-map :flow/predicate g)]
       (gen/fmap #(merge v %) false-gen)))))

(defn short-circuit-flow-condition-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map :flow/short-circuit? (gen/return true))]
       (gen/fmap #(merge v %) g)))))

(defn exception-flow-condition-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map
              :flow/thrown-exception? (gen/return true)
              :flow/short-circuit? (gen/return true)
              :flow/post-transform (gen/one-of
                                    [(gen/return nil)
                                     (gen/return ::post-transform)]))]
       (gen/fmap #(merge v %) g)))))

(defn retry-flow-condition-gen [base-gen]
  (gen/bind
   base-gen
   (fn [v]
     (let [g (gen/hash-map :flow/action (gen/return :retry))]
       (gen/fmap #(merge v %) g)))))

(deftest nil-flow-conditions
  "No flow condition routes to all downstream tasks"
