Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java API
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Other JSE/JEE APIs
How to exclude DS and JPA autoconfig in JUnit for Spring 2+?
Arthur Harkivsky
Greenhorn
Posts: 15
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How to exclude DS and JPA autoconfig in
JUnit
for Spring 2+?
Current anotation based "solution" does not work.
I want to do this to decrease time of
testing
pipeline.
import org.springframework.boot.test.context.SpringBootTest;//... import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.TestConfiguration; @SpringBootTest @ExtendWith(value = { SpringExtension.class}) public abstract class AbstractComponentIntegrationTest { @ExcludeDb @TestConfiguration static class ExcludeDbConfiguration { } } import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; @Inherited @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class}) public @interface ExcludeDb { }
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Method Security With @PreAuthorize - RequestHeader Does Not Refresh After 403
Generating RESTful web services dynamically
Annotations and reuse
CDI Error for interceptor on Websphere 8.5
Scanning for Beans with particular annotation
More...