summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShwetank Dave <shwetank.dave@amdocs.com>2018-06-11 10:15:34 -0400
committerShwetank Dave <shwetank.dave@amdocs.com>2018-07-26 09:13:18 -0400
commite16bda37d76e63e0f903bba13ed1dccf3b17f395 (patch)
tree1b8036103cf598bc645e3d4da1b6340d9c164447 /test
parent36b5671af2c3eec5ca81663382c4ca2898f79e55 (diff)
Add logging and tests and build using mvn
An initial version of adding logs to chameleon An initial version of adding specs (tests) to chameleon. Adding pom.xml so the project can be build using maven. Updating README.md for instructions on running it locally. Issue-ID: AAI-1220 Change-Id: I85f46fd7f625c83b84f211d6766970431e6d91eb Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
Diffstat (limited to 'test')
-rw-r--r--test/chameleon/testing.clj42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/chameleon/testing.clj b/test/chameleon/testing.clj
new file mode 100644
index 0000000..13acb1a
--- /dev/null
+++ b/test/chameleon/testing.clj
@@ -0,0 +1,42 @@
+(ns chameleon.testing
+ (:require [clojure.test :as t]
+ [clojure.spec.alpha :as s]
+ [clojure.spec.gen.alpha :as gen]
+ [clojure.spec.test.alpha :as st]
+ [chameleon.logging :as log]
+ [chameleon.specs :as cs]
+ [chameleon.route :as cr]
+ [chameleon.aai-processor :as cai]))
+
+(s/fdef chameleon.route/assert-gallifrey!
+ :args (s/cat :host :chameleon.specs/host
+ :provenance :chameleon.specs/provenance
+ :type :chameleon.specs/type
+ :payload :chameleon.specs/payload
+ :loggers :chameleon.specs/loggers)
+ :ret nil?)
+
+(s/fdef chameleon.aai-processor/from-spike
+ :args (s/cat :gallifrey-host :chameleon.specs/host
+ :payload :spike/payload
+ :loggers :chameleon.specs/loggers)
+ :ret nil?)
+
+(s/fdef chameleon.aai-processor/from-gallifrey
+ :args (s/cat :body :gallifrey/payload)
+ :ret map?)
+
+(s/fdef chameleon.aai-processor/gen-trim-relationship
+ :args (s/cat :relationship :chameleon.specs/relationship)
+ :ret map?)
+
+(st/instrument 'chameleon.route/assert-gallifrey! {:stub '(chameleon.route/assert-gallifrey!)})
+
+;; Testing instrumentation
+(chameleon.route/assert-gallifrey! "host" "aai" "type" {} (log/error-logger "chameleon.testing") (log/audit-logger "chameleon.testing"))
+
+(->> '(chameleon.aai-processor/from-spike
+ chameleon.aai-processor/from-gallifrey
+ chameleon.aai-processor/gen-trim-relationship)
+ st/check
+ st/summarize-results)