BAEL-20869 Move remaining spring boot modules
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.baeldung.properties;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
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.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ExternalPropertyFileLoader.class)
|
||||
public class ExternalPropertyFileLoaderIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
ConfProperties props;
|
||||
|
||||
@Test
|
||||
public void whenExternalisedPropertiesLoaded_thenReadValues() throws IOException {
|
||||
assertEquals("jdbc:postgresql://localhost:5432/", props.getUrl());
|
||||
assertEquals("admin", props.getUsername());
|
||||
assertEquals("root", props.getPassword());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user