Skip to content

Commit 4e53cd8

Browse files
authored
Merge pull request eugenp#5373 from eugenp/fix-nth-root
removed unnecessary Mockito and refactored test method name
2 parents 762bcc8 + 2784b3d commit 4e53cd8

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
import org.mockito.InjectMocks;
88
import org.mockito.junit.MockitoJUnitRunner;
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)