Skip to content

Instantly share code, notes, and snippets.

@rbaul
Created January 14, 2019 12:43
Show Gist options
  • Save rbaul/cfdca9651fc8ee70509a290c8d37b1bd to your computer and use it in GitHub Desktop.
Save rbaul/cfdca9651fc8ee70509a290c8d37b1bd to your computer and use it in GitHub Desktop.
Application context loads test (Change to H2 DB and set local profile)
dependencies {
testCompile('com.h2database:h2')
}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureTestDatabase
@ActiveProfiles("local_dev")
public class MercuryOApplicationTests {
@Test
public void contextLoads() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment