Skip to content

Commit

Permalink
Merge pull request #51 from seki-seki/feature/execute-404
Browse files Browse the repository at this point in the history
Feature/execute 404
  • Loading branch information
kawasima authored Dec 27, 2016
2 parents 7185369 + 14aa8e3 commit ebf64b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/clj/job_streamer/control_bus/component/jobs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@
(not (:job/exclusive? (:job ctx)))))
:put-to-existing? (fn [ctx]
(#{:put :post} (get-in ctx [:request :request-method])))
:post-to-missing? (fn [ctx] (find-by-name jobs app-name job-name))
:conflict? (fn [{job :job}]
(if-let [last-execution (some->> (:job/executions job)
(sort #(compare (:job-execution/create-time %2) (:job-execution/create-time %1)))
Expand Down
14 changes: 10 additions & 4 deletions test/clj/job_streamer/control_bus/component/jobs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,16 @@
:step-execution-id 11111111111111}]})
(is (= "SUCCESS" (-> request handler :body read-string :job-execution/step-executions first :step-execution/exit-status)))))))





(deftest executions-resource
(let [system (new-system config)]
;; setup data
((-> (jobs/list-resource (:jobs system) "default")) {:request-method :post
:content-type "application/edn"
:body (pr-str {:job/name "job1"})})
(testing "return 404 when job-name is not exist"
(let [handler (-> (jobs/executions-resource (:jobs system) "default" "job2"))
request {:request-method :post}]
(is (= 404 (-> request handler :status)))))))

(deftest parse-query
(testing "parse-query"
Expand Down

0 comments on commit ebf64b6

Please sign in to comment.