|
1 | 1 | (ns backtype.storm.nimbus-test
|
2 | 2 | (:use [clojure test])
|
| 3 | + (:require [backtype.storm [util :as util]]) |
3 | 4 | (:require [backtype.storm.daemon [nimbus :as nimbus]])
|
4 |
| - |
5 | 5 | (:import [backtype.storm.testing TestWordCounter TestWordSpout TestGlobalCount TestAggregatesCounter])
|
6 | 6 | (:import [backtype.storm.scheduler INimbus])
|
7 | 7 | (:use [backtype.storm bootstrap testing])
|
|
892 | 892 | (testing "getTopologyConf calls check-authorization! with the correct parameters."
|
893 | 893 | (let [expected-operation "getTopologyConf"]
|
894 | 894 | (stubbing [nimbus/check-authorization! nil
|
895 |
| - nimbus/try-read-storm-conf expected-conf] |
| 895 | + nimbus/try-read-storm-conf expected-conf |
| 896 | + util/to-json nil] |
896 | 897 | (try
|
897 | 898 | (.getTopologyConf nimbus "fake-id")
|
898 | 899 | (catch NotAliveException e)
|
899 | 900 | (finally
|
900 | 901 | (verify-first-call-args-for-indices
|
901 |
| - nimbus/check-authorization! |
902 |
| - [1 2 3] expected-name expected-conf expected-operation)))))) |
| 902 | + nimbus/check-authorization! |
| 903 | + [1 2 3] expected-name expected-conf expected-operation) |
| 904 | + (verify-first-call-args-for util/to-json expected-conf)))))) |
903 | 905 |
|
904 | 906 | (testing "getTopology calls check-authorization! with the correct parameters."
|
905 | 907 | (let [expected-operation "getTopology"]
|
906 | 908 | (stubbing [nimbus/check-authorization! nil
|
907 |
| - nimbus/try-read-storm-conf expected-conf] |
| 909 | + nimbus/try-read-storm-conf expected-conf |
| 910 | + nimbus/try-read-storm-topology nil |
| 911 | + system-topology! nil] |
908 | 912 | (try
|
909 | 913 | (.getTopology nimbus "fake-id")
|
910 | 914 | (catch NotAliveException e)
|
911 | 915 | (finally
|
912 | 916 | (verify-first-call-args-for-indices
|
913 |
| - nimbus/check-authorization! |
914 |
| - [1 2 3] expected-name expected-conf expected-operation)))))) |
| 917 | + nimbus/check-authorization! |
| 918 | + [1 2 3] expected-name expected-conf expected-operation) |
| 919 | + (verify-first-call-args-for-indices |
| 920 | + system-topology! [0] expected-conf)))))) |
915 | 921 |
|
916 | 922 | (testing "getUserTopology calls check-authorization with the correct parameters."
|
917 | 923 | (let [expected-operation "getUserTopology"]
|
|
923 | 929 | (catch NotAliveException e)
|
924 | 930 | (finally
|
925 | 931 | (verify-first-call-args-for-indices
|
926 |
| - nimbus/check-authorization! |
927 |
| - [1 2 3] expected-name expected-conf expected-operation)))))))))) |
| 932 | + nimbus/check-authorization! |
| 933 | + [1 2 3] expected-name expected-conf expected-operation) |
| 934 | + (verify-first-call-args-for-indices |
| 935 | + nimbus/try-read-storm-topology [0] expected-conf)))))))))) |
928 | 936 |
|
929 | 937 | (deftest test-nimbus-iface-getTopology-methods-throw-correctly
|
930 | 938 | (with-local-cluster [cluster]
|
|
0 commit comments