Guest User

Untitled

a guest
Jan 17th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. @SpringBootApplication
  2. @EnableDiscoveryClient
  3. public class Application {
  4. private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
  5.  
  6. public static void main(String[] args) {
  7. LOGGER.info("Starting Application");
  8. ConfigurableApplicationContext context = new SpringApplicationBuilder(Application.class)
  9. .properties("spring.config.name:application,db-config")
  10. .build().run(args);
  11.  
  12. ConfigurableEnvironment environment = context.getEnvironment();
  13.  
  14. LOGGER.info("OpendoorServiceApplication config file loaded successfully: {}", environment.getProperty("spring.application.name"));
  15. LOGGER.info("Database config file loaded successfully: {}", environment.getProperty("mes.db.environment"));
  16. }
  17. }
  18.  
  19. @RunWith(SpringRunner.class)
  20. @SpringBootTest(classes=Application.class)
  21. public class ApplicationTests {
  22.  
  23. @Test
  24. public void applicationContextLoaded() {
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment