From 8861efd87ae098f976fc4c7a86a43e4b296c0310 Mon Sep 17 00:00:00 2001 From: Alex Golub Date: Fri, 22 Apr 2022 21:23:47 +0300 Subject: [PATCH] Swap these 2 arguments, so they are in the correct order: expected value, actual value --- .../com/baeldung/junit5/order/AlphanumericOrderUnitTest.java | 2 +- .../java/com/baeldung/junit5/order/CustomOrderUnitTest.java | 5 ++--- .../com/baeldung/junit5/order/OrderAnnotationUnitTest.java | 5 +++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/AlphanumericOrderUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/AlphanumericOrderUnitTest.java index 7fc32c0cc0..3a873a6d29 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/AlphanumericOrderUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/AlphanumericOrderUnitTest.java @@ -29,6 +29,6 @@ public class AlphanumericOrderUnitTest { @AfterAll public static void assertOutput() { - assertEquals(output.toString(), "ABa"); + assertEquals("ABa", output.toString()); } } diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/CustomOrderUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/CustomOrderUnitTest.java index 472c98e923..299a3cad85 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/CustomOrderUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/CustomOrderUnitTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @TestMethodOrder(CustomOrder.class) public class CustomOrderUnitTest { - private static StringBuilder output = new StringBuilder(""); + private static final StringBuilder output = new StringBuilder(""); @Test void myATest() { @@ -26,9 +26,8 @@ public class CustomOrderUnitTest { output.append("a"); } - @AfterAll public static void assertOutput() { - assertEquals(output.toString(), "AaB"); + assertEquals("AaB", output.toString()); } } diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/OrderAnnotationUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/OrderAnnotationUnitTest.java index 72c8bcc2a9..14cf6c552e 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/OrderAnnotationUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/junit5/order/OrderAnnotationUnitTest.java @@ -7,7 +7,8 @@ import static org.junit.jupiter.api.Assertions.*; @TestMethodOrder(OrderAnnotation.class) public class OrderAnnotationUnitTest { - private static StringBuilder output = new StringBuilder(""); + + private static final StringBuilder output = new StringBuilder(); @Test @Order(1) @@ -29,6 +30,6 @@ public class OrderAnnotationUnitTest { @AfterAll public static void assertOutput() { - assertEquals(output.toString(), "abc"); + assertEquals("abc", output.toString()); } }