From 54a5b1e75ccba8d19c388a4c7aac760815a3f23d Mon Sep 17 00:00:00 2001 From: Jan Ortner Date: Wed, 19 Jan 2022 20:19:16 +0100 Subject: [PATCH] First assertJ Test and Jenkins configuration testing --- src/main/java/Dog.java | 10 ++++++++++ src/main/java/Test.java | 2 -- src/test/java/DogTest.java | 15 +++++++++++++++ src/test/java/TestTest.java | 5 ----- 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 src/main/java/Dog.java delete mode 100644 src/main/java/Test.java create mode 100644 src/test/java/DogTest.java delete mode 100644 src/test/java/TestTest.java diff --git a/src/main/java/Dog.java b/src/main/java/Dog.java new file mode 100644 index 0000000..bd85775 --- /dev/null +++ b/src/main/java/Dog.java @@ -0,0 +1,10 @@ +public class Dog { + private String name; + private Float weight; + + public Dog(String name, double weight) { + + } + + +} \ No newline at end of file diff --git a/src/main/java/Test.java b/src/main/java/Test.java deleted file mode 100644 index a065407..0000000 --- a/src/main/java/Test.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Test { -} diff --git a/src/test/java/DogTest.java b/src/test/java/DogTest.java new file mode 100644 index 0000000..889fc34 --- /dev/null +++ b/src/test/java/DogTest.java @@ -0,0 +1,15 @@ +import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.*; + +class DogTest { + + Dog fido = new Dog("Fido", 5.25); + + Dog fidosClone = new Dog("Fido", 5.25); + + @Test + void test() { + assertThat(fido).isEqualToComparingFieldByFieldRecursively(fidosClone); + } + +} \ No newline at end of file diff --git a/src/test/java/TestTest.java b/src/test/java/TestTest.java deleted file mode 100644 index e6533bb..0000000 --- a/src/test/java/TestTest.java +++ /dev/null @@ -1,5 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; - -class TestTest { - -} \ No newline at end of file