TMP
authorKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 11:53:03 +0000 (12:53 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 11:53:03 +0000 (12:53 +0100)
src/test/java/de/juplo/demo/DemoApplicationIT.java
src/test/resources/text.html [new file with mode: 0644]

index 674efc8..92830b8 100644 (file)
@@ -36,7 +36,7 @@ class DemoApplicationIT extends IntegrationTestBase
         .exchange()
         .expectStatus().isOk()
         .expectHeader().contentType(MediaType.TEXT_HTML)
-        .expectBody(String.class).isEqualTo("Hello World!\n");
+        .expectBody().xpath("/html/body/main/div/div/pre", "Hello World!\n");
   }
 
   @Configuration
diff --git a/src/test/resources/text.html b/src/test/resources/text.html
new file mode 100644 (file)
index 0000000..459c3b3
--- /dev/null
@@ -0,0 +1,23 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <title>Shows Remote-Content</title>
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
+  </head>
+  <body>
+    <nav class="navbar navbar-dark bg-primary navbar-expand navbar-dark flex-column">
+      <h2 class="navbar-brand">Demo: Unit-Test or Integration-Test &mdash; A Practical Guide</h2>
+    </nav>
+    <main class="container mt-5">
+      <div class="card">
+        <div class="card-header" id="content"><h1>Rendered Remote-Content</h1></div>
+        <div class="card-body">
+          <p class="card-text"><pre>Hello World!
+</pre></p>
+        </div>
+      </div>
+    </main>
+  </body>
+</html>