Skip to content

Commit 2784b3d

Browse files
committed
removed unnecessary Mockito and refactored test method name
1 parent 0f18f28 commit 2784b3d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎core-java/src/test/java/com/baeldung/nth/root/calculator/NthRootCalculatorUnitTest.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77

88
import static org.junit.Assert.assertEquals;
99

10-
@RunWith(MockitoJUnitRunner.class)
1110
public class NthRootCalculatorUnitTest {
1211

13-
@InjectMocks
14-
private NthRootCalculator nthRootCalculator;
12+
private NthRootCalculator nthRootCalculator = new NthRootCalculator();
1513

1614
@Test
17-
public void giventThatTheBaseIs125_andTheExpIs3_whenCalculateIsCalled_thenTheResultIsTheCorrectOne() {
15+
public void whenBaseIs125AndNIs3_thenNthRootIs5() {
1816
Double result = nthRootCalculator.calculate(125.0, 3.0);
1917
assertEquals(result, (Double) 5.0d);
2018
}

0 commit comments

Comments
 (0)