From 3146226399b94c536a51e6f87bbe21099b185f23 Mon Sep 17 00:00:00 2001 From: Meysam Tamkin Date: Thu, 3 Sep 2020 10:16:45 +0430 Subject: [PATCH] Fix it some changes --- ...icTest.java => BeforeAndAfterAnnotationsUnitTest.java} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/{BeforeAfterAllNonStaticTest.java => BeforeAndAfterAnnotationsUnitTest.java} (70%) diff --git a/testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAfterAllNonStaticTest.java b/testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAndAfterAnnotationsUnitTest.java similarity index 70% rename from testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAfterAllNonStaticTest.java rename to testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAndAfterAnnotationsUnitTest.java index 8dbe95ddf8..1bfea8447b 100644 --- a/testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAfterAllNonStaticTest.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/junit5/nonstatic/BeforeAndAfterAnnotationsUnitTest.java @@ -3,7 +3,7 @@ package com.baeldung.junit5.nonstatic; import org.junit.jupiter.api.*; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public class BeforeAfterAllNonStaticTest { +public class BeforeAndAfterAnnotationsUnitTest { String input; Long result; @@ -15,11 +15,13 @@ public class BeforeAfterAllNonStaticTest { @AfterAll public void teardown() { - Assertions.assertEquals(77l, result); + input = null; + result = null; } @Test - public void testConvertStringToLong() { + public void whenConvertStringToLong_thenResultShouldBeLong() { result = Long.valueOf(input); + Assertions.assertEquals(77l, result); } }