* BAEL-2569 : EnvironmentPostProcessor in Spring Boot

* BAEL-2569 add test

* BAEL-2569 update test

* BAEL-2569  refactoring the class PriceCalculationEnvironmentPostProcessor

* BAEL-2569: changes to class PriceCalculationEnvironmentPostProcessor

* BAEL-2569 move code to spring-boot-ops module
This commit is contained in:
letcodespeak
2019-04-08 01:51:00 +10:00
committed by maibin
parent 9ffec6819c
commit b9d34bfc7a
10 changed files with 7 additions and 6 deletions
@@ -1,26 +0,0 @@
package com.baeldung.environmentpostprocessor;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.baeldung.environmentpostprocessor.service.PriceCalculationService;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PriceCalculationApplication.class)
public class PriceCalculationEnvironmentPostProcessorLiveTest {
@Autowired
PriceCalculationService pcService;
@Test
public void whenSetNetEnvironmentVariablebyDefault_thenNoTaxApplied() {
double total = pcService.productTotalPrice(100, 4);
assertEquals(400.0, total, 0);
}
}