From 5569d385ed35b60eede1bdac93e8899702e1b3ba Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Sun, 1 Dec 2019 20:00:42 +0100
Subject: [PATCH] [tests] gva: replace pretty_assertions by assert_json_diff

---
 Cargo.lock                            | 12 +++++++++++-
 lib/modules/gva/Cargo.toml            |  2 +-
 lib/modules/gva/src/schema/queries.rs |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index b246e363..c498bfce 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -287,6 +287,15 @@ name = "ascii"
 version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "assert-json-diff"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "atty"
 version = "0.2.13"
@@ -1040,6 +1049,7 @@ name = "durs-gva"
 version = "0.1.0"
 dependencies = [
  "actix-web 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "assert-json-diff 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "dubp-block-doc 0.1.0",
@@ -1061,7 +1071,6 @@ dependencies = [
  "juniper-from-schema 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "mockall 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3360,6 +3369,7 @@ dependencies = [
 "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
 "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
 "checksum ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
+"checksum assert-json-diff 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9881d306dee755eccf052d652b774a6b2861e86b4772f555262130e58e4f81d2"
 "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"
 "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
 "checksum awc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5e995283278dd3bf0449e7534e77184adb1570c0de8b6a50bf7c9d01ad8db8c4"
diff --git a/lib/modules/gva/Cargo.toml b/lib/modules/gva/Cargo.toml
index e4a63861..01f2570a 100644
--- a/lib/modules/gva/Cargo.toml
+++ b/lib/modules/gva/Cargo.toml
@@ -35,10 +35,10 @@ serde_json = "1.0.41"
 structopt= "0.3.4"
 
 [dev-dependencies]
+assert-json-diff = "1.0.1"
 durs-bc-db-reader = { path = "../../modules-lib/bc-db-reader", features = ["client-indexer", "mock"] }
 dubp-blocks-tests-tools = { path = "../../tests-tools/blocks-tests-tools" }
 dup-crypto-tests-tools = { path = "../../tests-tools/crypto-tests-tools" }
 mockall = "0.5.2"
-pretty_assertions = "0.5.1"
 
 [features]
diff --git a/lib/modules/gva/src/schema/queries.rs b/lib/modules/gva/src/schema/queries.rs
index d8f9bc71..18dc58ed 100644
--- a/lib/modules/gva/src/schema/queries.rs
+++ b/lib/modules/gva/src/schema/queries.rs
@@ -32,8 +32,8 @@ mod tests {
     use actix_web::http;
     use actix_web::test;
     use actix_web::web;
+    use assert_json_diff::assert_json_eq;
     use juniper::http::GraphQLRequest;
-    use pretty_assertions::assert_eq;
     use std::str::FromStr;
     use std::sync::Arc;
 
@@ -65,7 +65,7 @@ mod tests {
         .unwrap();
         assert_eq!(resp.status(), http::StatusCode::OK);
         if let Some(Body::Bytes(ref body_bytes)) = resp.body().as_ref() {
-            assert_eq!(
+            assert_json_eq!(
                 expected_response,
                 serde_json::Value::from_str(
                     &String::from_utf8(body_bytes.to_vec())
-- 
GitLab