got all tests working from the terminal. screw the ide

This commit is contained in:
Greg Gauthier 2023-05-26 19:17:17 +01:00
parent 633e7a059e
commit c209f3d1be
3 changed files with 19 additions and 13 deletions

20
pom.xml
View File

@ -121,13 +121,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -142,6 +135,19 @@
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<includes>
<include>**/CalculatorClientTests.java</include>
<include>**/CalculatorControllerTest.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

View File

@ -7,7 +7,6 @@ import com.hackerrank.test.utility.OrderedTestRunner;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@ -16,6 +15,7 @@ import java.math.BigDecimal;
import java.net.URISyntaxException;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static org.junit.Assert.assertEquals;
@SpringBootTest
@RunWith(OrderedTestRunner.class)
@ -41,7 +41,7 @@ public class CalculatorClientTests {
.withBody("{\"sum\": 4}")));
CalculatorClient calc = new CalculatorClient();
Integer resp = calc.getSum(2,2);//two plus two
Assertions.assertEquals(4, resp.intValue());
assertEquals(4, resp.intValue());
}
@Test
@ -55,7 +55,7 @@ public class CalculatorClientTests {
.withBody("{\"difference\": 4}")));
CalculatorClient calc = new CalculatorClient();
Integer resp = calc.getDifference(6,2); //six minus two
Assertions.assertEquals(4, resp.intValue());
assertEquals(4, resp.intValue());
}
@Test
@ -69,7 +69,7 @@ public class CalculatorClientTests {
.withBody("{\"product\": 4}")));
CalculatorClient calc = new CalculatorClient();
Integer resp = calc.getProduct(2,2);//two times two
Assertions.assertEquals(4, resp.intValue());
assertEquals(4, resp.intValue());
}
@Test
@ -83,6 +83,6 @@ public class CalculatorClientTests {
.withBody("{\"quotient\": 4}")));
CalculatorClient calc = new CalculatorClient();
BigDecimal resp = calc.getQuotient(8,2);//eight divided by two
Assertions.assertEquals(BigDecimal.valueOf(4), resp);
assertEquals(BigDecimal.valueOf(4), resp);
}
}