BAEL-804 - minor code refactors
This commit is contained in:
parent
75c9345efa
commit
19439943b7
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>gateway</artifactId>
|
<artifactId>gateway</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>cd
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>parent-boot-4</artifactId>
|
<artifactId>parent-boot-4</artifactId>
|
||||||
|
|
|
@ -18,7 +18,7 @@ import com.baeldung.spring.drools.model.TaxiRide;
|
||||||
public class TaxiFareCalculatorServiceIntegrationTest {
|
public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TaxiFareCalculatorService taxiFareCalculatorService;
|
private TaxiFareCalculatorService taxiFareCalculatorService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenNightSurchargeFalseAndDistanceLessThan10_thenFixFareWithoutNightSurcharge() {
|
public void whenNightSurchargeFalseAndDistanceLessThan10_thenFixFareWithoutNightSurcharge() {
|
||||||
|
@ -27,6 +27,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(9L);
|
taxiRide.setDistanceInMile(9L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(70), totalCharge);
|
assertEquals(Long.valueOf(70), totalCharge);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +39,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(5L);
|
taxiRide.setDistanceInMile(5L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(100), totalCharge);
|
assertEquals(Long.valueOf(100), totalCharge);
|
||||||
}
|
}
|
||||||
|
@ -49,6 +51,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(50L);
|
taxiRide.setDistanceInMile(50L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(170), totalCharge);
|
assertEquals(Long.valueOf(170), totalCharge);
|
||||||
}
|
}
|
||||||
|
@ -60,6 +63,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(50L);
|
taxiRide.setDistanceInMile(50L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(250), totalCharge);
|
assertEquals(Long.valueOf(250), totalCharge);
|
||||||
}
|
}
|
||||||
|
@ -71,6 +75,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(100L);
|
taxiRide.setDistanceInMile(100L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(220), totalCharge);
|
assertEquals(Long.valueOf(220), totalCharge);
|
||||||
}
|
}
|
||||||
|
@ -82,6 +87,7 @@ public class TaxiFareCalculatorServiceIntegrationTest {
|
||||||
taxiRide.setDistanceInMile(100L);
|
taxiRide.setDistanceInMile(100L);
|
||||||
Fare rideFare = new Fare();
|
Fare rideFare = new Fare();
|
||||||
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
Long totalCharge = taxiFareCalculatorService.calculateFare(taxiRide, rideFare);
|
||||||
|
|
||||||
assertNotNull(totalCharge);
|
assertNotNull(totalCharge);
|
||||||
assertEquals(Long.valueOf(350), totalCharge);
|
assertEquals(Long.valueOf(350), totalCharge);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue