Skip to content

Commit

Permalink
Merge pull request Netflix#155 from daveray/hystrix-clj-reset-fixture
Browse files Browse the repository at this point in the history
Reset Hystrix after tests have run.
  • Loading branch information
benjchristensen committed Jul 24, 2013
2 parents 87c62c7 + cc2246a commit c7a30b8
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
(ns com.netflix.hystrix.core-test
(:use com.netflix.hystrix.core)
(:require [clojure.test :refer [deftest testing is are use-fixtures]])
(:import [com.netflix.hystrix HystrixExecutable]
(:import [com.netflix.hystrix Hystrix HystrixExecutable]
[com.netflix.hystrix.strategy.concurrency HystrixRequestContext]))

; reset hystrix after each execution, for consistency and sanity
(defn reset-fixture
[f]
(try
(f)
(finally
(Hystrix/reset))))

(use-fixtures :once reset-fixture)

; wrap each test in hystrix context
(defn request-context-fixture
[f]
Expand Down

0 comments on commit c7a30b8

Please sign in to comment.