         (let [request {:configuration {:jenkins {:currently-building-view "Building"
                                              :jenkins-url "http://10.20.30.40:8080/"}}}]
             (is (= (read-currently-building-jobs request)
-               [{"_class" "hudson.model.FreeStyleProject",
-                 "name" "test-Example_Documentation-1.0-Guide-en-US (preview)",
-                 "url"
-                 "http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(preview)/",
-                 "buildable" true,
-                 "color" "yellow_anime",
-                 "lastSuccessfulBuild"
-                 {"_class" "hudson.model.FreeStyleBuild",
-                  "description" "Total: 4  Passed: 1  Failed: 3"},
-                  "scm"
-                 {"_class" "hudson.plugins.git.GitSCM",
-                  "userRemoteConfigs"
-                  [{"url" "git@git.domain.name:example-documentation/guide.git"}]}}
-                {"_class" "hudson.model.FreeStyleProject",
-                 "name" "test-Example_Documentation-1.0-Guide-en-US (stage)",
-                 "url"
-                 "http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(stage)/",
-                 "buildable" true,
-                 "color" "yellow_anime",
-                 "lastSuccessfulBuild"
-                 {"_class" "hudson.model.FreeStyleBuild",
-                  "description" "Total: 4  Passed: 1  Failed: 3"},
-                 "scm"
-                 {"_class" "hudson.plugins.git.GitSCM",
-                  "userRemoteConfigs"
-                  [{"url" "git@git.domain.name:example-documentation/guide.git"}]}}])))))
+                    read-currently-building-jobs-expected-result)))))
 
 (deftest test-get-currently-building-jobs
     "Check the function emender-jenkins.rest-api/get-currently-building-jobs."

                     :command "currently_building_jobs"
                     :message "Can not read Jenkins view"}))))))

(def jobs-in-queue-jenkins-response
    (str "{\"_class\":\"hudson.model.Queue\","
          "\"items\":["
             "{\"_class\":\"hudson.model.Queue$BlockedItem\",\"task\":{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (preview)\"}}"
             "{\"_class\":\"hudson.model.Queue$BlockedItem\",\"task\":{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (stage)  \"}}"
         "]}"))

(deftest test-read-queue-info-from-jenkins
    "Check the function emender-jenkins.rest-api/read-queue-info-from-jenkins."
    (testing "the function emender-jenkins.rest-api/read-queue-info-from-jenkins."
    (with-redefs [jenkins-api/get-command (fn [url] jobs-in-queue-jenkins-response)]
        (is (= (read-queue-info-from-jenkins "url")
             [{"_class" "hudson.model.Queue$BlockedItem" "task" {"_class" "hudson.model.FreeStyleProject" "name" "test-Example_Documentation-1.0-Guide-en-US (preview)"}}
              {"_class" "hudson.model.Queue$BlockedItem" "task" {"_class" "hudson.model.FreeStyleProject" "name" "test-Example_Documentation-1.0-Guide-en-US (stage)  "}}]
    )))))

(deftest test-read-queue-info-from-jenkins-negative
    "Check the function emender-jenkins.rest-api/read-queue-info-from-jenkins."



(def building-jobs-jenkins-response
    (str "{\"_class\":\"hudson.model.ListView\","
          "\"jobs\":["
          "{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (preview)\",\"url\":\"http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(preview)/\",\"buildable\":true,\"color\":\"yellow_anime\",\"lastSuccessfulBuild\":{\"_class\":\"hudson.model.FreeStyleBuild\",\"description\":\"Total: 4  Passed: 1  Failed: 3\"},\"scm\":{\"_class\":\"hudson.plugins.git.GitSCM\",\"userRemoteConfigs\":[{\"url\":\"git@git.domain.name:example-documentation/guide.git\"}]}},"
          "{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (stage)\",\"url\":\"http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(stage)/\",\"buildable\":true,\"color\":\"yellow_anime\",\"lastSuccessfulBuild\":{\"_class\":\"hudson.model.FreeStyleBuild\",\"description\":\"Total: 4  Passed: 1  Failed: 3\"},\"scm\":{\"_class\":\"hudson.plugins.git.GitSCM\",\"userRemoteConfigs\":[{\"url\":\"git@git.domain.name:example-documentation/guide.git\"}]}}"
          "]}"))

(def jobs-in-queue-jenkins-response
    (str "{\"_class\":\"hudson.model.Queue\","
          "\"items\":["
             "{\"_class\":\"hudson.model.Queue$BlockedItem\",\"task\":{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (preview)\"}}"
             "{\"_class\":\"hudson.model.Queue$BlockedItem\",\"task\":{\"_class\":\"hudson.model.FreeStyleProject\",\"name\":\"test-Example_Documentation-1.0-Guide-en-US (stage)  \"}}"
         "]}"))

(def read-currently-building-jobs-expected-result
   [{"_class" "hudson.model.FreeStyleProject",
     "name" "test-Example_Documentation-1.0-Guide-en-US (preview)",
     "url"
     "http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(preview)/",
     "buildable" true,
     "color" "yellow_anime",
     "lastSuccessfulBuild"
     {"_class" "hudson.model.FreeStyleBuild",
      "description" "Total: 4  Passed: 1  Failed: 3"},
      "scm"
     {"_class" "hudson.plugins.git.GitSCM",
      "userRemoteConfigs"
      [{"url" "git@git.domain.name:example-documentation/guide.git"}]}}
    {"_class" "hudson.model.FreeStyleProject",
     "name" "test-Example_Documentation-1.0-Guide-en-US (stage)",
     "url"
     "http://10.20.30.40:8080/job/test-Example_Documentation-1.0-Guide-en-US%20(stage)/",
     "buildable" true,
     "color" "yellow_anime",
     "lastSuccessfulBuild"
     {"_class" "hudson.model.FreeStyleBuild",
      "description" "Total: 4  Passed: 1  Failed: 3"},
     "scm"
     {"_class" "hudson.plugins.git.GitSCM",
      "userRemoteConfigs"
      [{"url" "git@git.domain.name:example-documentation/guide.git"}]}}])

(deftest test-read-queue-info-from-jenkins
    "Check the function emender-jenkins.rest-api/read-queue-info-from-jenkins."
    (testing "the function emender-jenkins.rest-api/read-queue-info-from-jenkins."
    (with-redefs [jenkins-api/get-command (fn [url] jobs-in-queue-jenkins-response)]
        (is (= (read-queue-info-from-jenkins "url")
             [{"_class" "hudson.model.Queue$BlockedItem" "task" {"_class" "hudson.model.FreeStyleProject" "name" "test-Example_Documentation-1.0-Guide-en-US (preview)"}}
              {"_class" "hudson.model.Queue$BlockedItem" "task" {"_class" "hudson.model.FreeStyleProject" "name" "test-Example_Documentation-1.0-Guide-en-US (stage)  "}}]
    )))))

(deftest test-read-building-jobs-from-jenkins
    "Check the function emender-jenkins.rest-api/read-building-jobs-from-jenkins."
