Skip to content

Commit

Permalink
Adding TestNG dependencies, code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Jul 4, 2018
1 parent ff45cd6 commit 67ef3bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 12 additions & 1 deletion Mockito-Examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<artifactId>junit-platform-runner</artifactId>
<version>1.2.0</version>
<scope>test</scope>
<!-- -->
<exclusions>
<exclusion>
<groupId>junit</groupId>
Expand All @@ -34,6 +33,13 @@
<version>2.19.0</version>
<scope>test</scope>
</dependency>
<!-- TestNG Dependencies -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -55,6 +61,11 @@
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>2.22.0</version>
</dependency>
</dependencies>
<configuration>
<additionalClasspathElements>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.journaldev.mockito.testng;

import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;

import org.mockito.Mockito;
import static org.testng.Assert.assertEquals;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

Expand All @@ -21,8 +21,8 @@ public void test_mock_object(int i, int j) {

addService = Mockito.mock(AddService.class);
calcService = new CalcService(addService);
int expected = i+j;

int expected = i + j;
when(addService.add(i, j)).thenReturn(expected);

int actual = calcService.calc(i, j);
Expand Down

0 comments on commit 67ef3bb

Please sign in to comment.