Bael 5543 - Running a spring boot app without DB (#12339)
* BAEL-5543 - Running a spring boot app without db * BAEL-5543 - Adding authentication properties * BAEL-5543 - Moving to a new module * BAEL-5543 - Changing test class name * BAEL-5543 - Reducing Java version Co-authored-by: Abhinav Pandey <Abhinav2.Pandey@airtel.com>
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.baeldung.startwithoutdb;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@SpringBootTest(classes = StartWithoutDbApplication.class)
|
||||
class StartWithoutDbIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void givenAutoConfigDisabled_whenStarting_thenNoAutoconfiguredBeansInContext() {
|
||||
context.getBean(DataSource.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user