I already add #SpringBootTest in all testcase.
'Run all test' in IDEA is OK, but when I use Maven test it didn't work.
how to reuse context in Maven test commend.
has any friend meet this problem? thx!
my test case like this:
#SpringBootTest
class EventControllerTest extends BaseTester{
...
}
#RunWith(SpringRunner::class)
#SpringBootTest
class BaseTester{}
maven log:
2018-07-04 16:09:38.766 INFO [-,,,] 12601 --- [ Thread-9] o.s.w.c.s.GenericWebApplicationContext : Closing org.springframework.web.context.support.GenericWebApplicationContext#2577d6c8: startup date [Wed Jul 04 16:09:29 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#54eb2b70
2018-07-04 16:09:38.792 INFO [-,,,] 12601 --- [ Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
Running com.fintend.ctc.controller.InviteControllerTest
16:09:40.535 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.fintend.ctc.controller.InviteControllerTest]
16:09:40.541 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
16:09:40.549 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
16:09:40.570 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test c
Related
I have a spring boot project as producer which have API endpoints, created via RouterFunction.
That API endpoint call handler which call a service and then make a call to JPA repository.
We have used liquibase to create db tables and for writing testcases we have used postgressql testcontainer.
I have written base class for producer as below:
#SpringBootTest
public abstract class RestBase extends TestBase {
#Autowired
private AccountHandler accountHandler;
#BeforeEach
public void setup() {
RestAssuredWebTestClient.webTestClient(WebTestClient.bindToRouterFunction(
new RouterConfig(accountHandler).routes()).build());
}
}
However, when I am trying to run mvn clean install, below stack trace is coming.
[INFO] Running com.example.RestTest
2021-09-02 13:46:26.207 INFO 25420 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Neither #ContextConfiguration nor #ContextHierarchy found for test class [com.example.RestTest], using SpringBootContextLoader
2021-09-02 13:46:26.208 INFO 25420 --- [ main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [com.example.RestTest]: no resource found for suffixes {-context.xml, Context.groovy}.
2021-09-02 13:46:26.208 INFO 25420 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [com.example.RestTest]: RestTest does not declare any static, non-private, non-final, nested classes annotated with #Configuration.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.127 s <<< FAILURE! - in com.example.RestTest
[ERROR] com.example.RestTest Time elapsed: 0.127 s <<< ERROR!
java.lang.IllegalStateException: Unable to find a #SpringBootConfiguration, you need to use #ContextConfiguration or #SpringBootTest(classes=...) with your test
2021-09-02 13:46:26.346 INFO 25420 --- [ main] c.e.e.c.ContainerEnvironmentResource : Stopping all test containers.
2021-09-02 13:46:26.778 INFO 25420 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-09-02 13:46:26.781 INFO 25420 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-09-02 13:46:26.795 INFO 25420 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] RestTest ยป IllegalState Unable to find a #SpringBootConfiguration, you need to...
How to solve this issue? Is there any issue with my base test class?
Router Config class looks like below:
#Configuration
#RequiredArgsConstructor
public class RouterConfig {
private final AccountHandler accountHandler;
#Bean
public RouterFunction<ServerResponse> routes (){
return route()
.GET("/accounts",accountHandler::retrieveAccountByFilter)
.build();
}
}
I mean literally it is said right there in the error message what you should do. Just provide the configuration class in #SpringBootTest annotation. Also for contract tests you should not start any databases or repositories. You should mock them out.
Make sure that the classes you are testing are in the same namespace as your #SpringBootApplication class, or are in namespaces UNDER the namespace that contains your #SpringBootApplication class.
For example, if your app class is in com.example.demo.MyApplication but the classes you are testing is com.example.MyClass S
Or if they need to be in separate namespace trees, you may try adding the list of app classes to your #SpringBootTest annotation, e.g.
#SpringBootTest(classes=YouAppClassName.class)
public abstract class RestBase extends TestBase {
...
}
We have written a basic streams processor using Spring Cloud Stream (3.0.9.RELEASE) and the Kafka streams binder. The actual project contains multiple classes annotated with #SpringBootApplication, each with their own functions, but only one is used at a time.
The issue we're having is that, when bundling our app into a JAR and running it as a k8s deployment, if we run any more than 1 replica at a time, those additional replicas terminate after a few minutes with no meaningful error message or obvious reason why. For example, if we run 5 replicas, 1 will stay up indefinitely and process events, but the other 4 (although they too initially start to process events) will exit shortly after. Obviously if we set our deployment to run only 1 replica there is no issue, but the processor needs to be scalable.
This section of the documentation regarding setting an application ID seems relevant:
For production deployments, it is highly recommended to explicitly specify the application ID
through configuration. This is especially going to be very critical if you are auto scaling your
application in which case you need to make sure that you are deploying each instance with the
same application ID.
but neither setting this value at the binding level (for our normalize function):
spring:
cloud:
stream:
kafka:
streams:
binder:
functions:
normalize:
applicationId: normalizer-full
nor setting it at the binder level:
spring:
cloud:
stream:
kafka:
streams:
binder:
applicationId: normalizer-full
seems to be able to keep the subsequent pods running.
Any help appreciated.
-- EDIT --
Here is a capture of the trace logging When the processor shuts down after several minutes:
2020-11-20 06:32:09.721 DEBUG 1 --- [extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#34f7cfd9, started on Fri Nov 20 06:26:59 GMT 2020
2020-11-20 06:32:09.722 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'org.springframework.integration.config.IdGeneratorConfigurer#0'
2020-11-20 06:32:09.722 DEBUG 1 --- [extShutdownHook] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#5e1dde44, started on Fri Nov 20 06:27:23 GMT 2020, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#34f7cfd9
2020-11-20 06:32:09.722 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'lifecycleProcessor'
2020-11-20 06:32:09.723 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#38830ea: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,KStreamBinderConfiguration,org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory,org.springframework.boot.autoconfigure.kafka.KafkaAnnotationDrivenConfiguration,org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration,org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor,org.springframework.boot.context.internalConfigurationPropertiesBinderFactory,org.springframework.boot.context.internalConfigurationPropertiesBinder,org.springframework.boot.context.properties.BoundConfigurationProperties,org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata,org.springframework.cloud.stream.binder.kafka.streams.MultiBinderPropertiesConfiguration,provisioningProvider,kStreamBinder]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#7cb502c
2020-11-20 06:32:09.723 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Retrieved dependent beans for bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory': [org.springframework.context.annotation.internalConfigurationAnnotationProcessor]
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'lifecycleProcessor'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'org.springframework.kafka.config.internalKafkaListenerEndpointRegistry'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'outputBindingLifecycle'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'inputBindingLifecycle'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'streamsBuilderFactoryManager'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean '_org.springframework.integration.errorLogger'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'integrationHeaderChannelRegistry'
2020-11-20 06:32:09.724 TRACE 1 --- [extShutdownHook] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'stream-builder-normalize'
2020-11-20 06:32:09.724 DEBUG 1 --- [extShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483547
...
There is a project with 20 controllers approximately. Each controller has its corresponding test class.
When we try to add new controller tests classes, some of the previous tests which were running fine, starts to fail randomly. If any controller test class is annotated with #Ignore, tests get back to normal.
This is the exception thrown by the failing tests:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: org.springframework.web.context.support.GenericWebApplicationContext#22f3fadf has been closed already.
Full log of one failing test:
:: Spring Boot :: (v2.0.3.RELEASE)
2019-07-04T13:01:50,325 INFO [pool-1-thread-17]
o.s.b.StartupInfoLogger: Starting ZipCodeControllerTest on valhala
with PID 17817 (started by wblanck in /home/wblanck/Projects/project)
2019-07-04T13:01:50,325 DEBUG [pool-1-thread-17]
o.s.b.StartupInfoLogger: Running with Spring Boot v2.0.3.RELEASE,
Spring v5.0.7.RELEASE 2019-07-04T13:01:50,325 INFO [pool-1-thread-17]
o.s.b.SpringApplication: No active profile set, falling back to
default profiles: default 2019-07-04T13:01:50,326 INFO
[pool-1-thread-17] o.s.c.s.AbstractApplicationContext: Refreshing
org.springframework.web.context.support.GenericWebApplicationContext#a5a2b92:
startup date [Thu Jul 04 13:01:50 ART 2019]; root of context hierarchy
2019-07-04T13:01:50,448 INFO [pool-1-thread-17]
o.s.b.f.a.AutowiredAnnotationBeanPostProcessor: JSR-330
'javax.inject.Inject' annotation found and supported for autowiring
2019-07-04T13:01:50,772 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractHandlerMethodMapping$MappingRegistry: Mapped
"{[/error]}" onto public
org.springframework.http.ResponseEntity
com.package.controller.WrongPathErrorController.badPathError(javax.servlet.http.HttpServletRequest)
2019-07-04T13:01:50,772 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractHandlerMethodMapping$MappingRegistry: Mapped
"{[/api/users/{device}/zip-code],methods=[GET],produces=[application/json]}"
onto public
org.springframework.http.ResponseEntity
com.package.controller.ZipCodeController.checkZipCode(java.lang.Integer,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String)
... more HandlerMethodMappings ...
2019-07-04T13:01:50,773 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractHandlerMethodMapping$MappingRegistry: Mapped
"{[/swagger-resources/configuration/ui]}" onto public
org.springframework.http.ResponseEntity
springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2019-07-04T13:01:50,773 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractHandlerMethodMapping$MappingRegistry: Mapped
"{[/swagger-resources]}" onto public
org.springframework.http.ResponseEntity>
springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2019-07-04T13:01:50,773 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractHandlerMethodMapping$MappingRegistry: Mapped
"{[/swagger-resources/configuration/security]}" onto public
org.springframework.http.ResponseEntity
springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2019-07-04T13:01:50,824 INFO [pool-1-thread-17]
s.d.s.w.PropertySourcedRequestMappingHandlerMapping: Mapped URL path
[/v2/api-docs] onto method [public
org.springframework.http.ResponseEntity
springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
2019-07-04T13:01:50,859 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractUrlHandlerMapping: Mapped URL path [//favicon.ico]
onto handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-07-04T13:01:50,913 INFO [pool-1-thread-17]
o.s.w.s.m.m.a.RequestMappingHandlerAdapter: Looking for
#ControllerAdvice:
org.springframework.web.context.support.GenericWebApplicationContext#a5a2b92:
startup date [Thu Jul 04 13:01:50 ART 2019]; root of context hierarchy
2019-07-04T13:01:50,931 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractUrlHandlerMapping: Mapped URL path [/webjars/]
onto handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-07-04T13:01:50,931 INFO [pool-1-thread-17]
o.s.w.s.h.AbstractUrlHandlerMapping: Mapped URL path [/**] onto
handler of type [class
org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-07-04T13:01:50,938 INFO [pool-1-thread-17]
o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver: Detected
#ExceptionHandler methods in integrationExceptionHandler
2019-07-04T13:01:50,981 INFO [pool-1-thread-17]
o.s.m.w.MockServletContext: Initializing Spring FrameworkServlet ''
2019-07-04T13:01:50,981 INFO [pool-1-thread-17]
o.s.w.s.FrameworkServlet: FrameworkServlet '': initialization started
2019-07-04T13:01:50,987 INFO [pool-1-thread-17]
o.s.w.s.FrameworkServlet: FrameworkServlet '': initialization
completed in 6 ms 2019-07-04T13:01:50,995 INFO [pool-1-thread-17]
o.s.c.s.DefaultLifecycleProcessor$LifecycleGroup: Starting beans in
phase 2147483647 2019-07-04T13:01:50,995 INFO [pool-1-thread-17]
s.d.s.w.p.DocumentationPluginsBootstrapper: Context refreshed
2019-07-04T13:01:50,995 INFO [pool-1-thread-17]
s.d.s.w.p.DocumentationPluginsBootstrapper: Found 1 custom
documentation plugin(s) 2019-07-04T13:01:50,999 INFO
[pool-1-thread-17] s.d.s.w.s.ApiListingReferenceScanner: Scanning for
api listing references 2019-07-04T13:01:51,109 INFO
[pool-1-thread-17] o.s.b.StartupInfoLogger: Started
ZipCodeControllerTest in 0.813 seconds (JVM running for 39.78)
2019-07-04T13:01:51,111 INFO [pool-1-thread-17]
o.s.c.s.AbstractApplicationContext: Closing
org.springframework.web.context.support.GenericWebApplicationContext#40554129:
startup date [Thu Jul 04 13:01:42 ART 2019]; root of context hierarchy
2019-07-04T13:01:51,112 INFO [pool-1-thread-17]
o.s.c.s.DefaultLifecycleProcessor$LifecycleGroup: Stopping beans in
phase 2147483647 Tests run: 3, Failures: 0, Errors: 1, Skipped: 0,
Time elapsed: 14.141 s <<< FAILURE! - in
com.package.controller.ZipCodeControllerTest
testInexistentCheckZipCode(com.package.controller.ZipCodeControllerTest)
Time elapsed: 10.648 s <<< ERROR!
org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is
java.lang.IllegalStateException:
org.springframework.web.context.support.GenericWebApplicationContext#22f3fadf
has been closed already at
com.package.controller.ZipCodeControllerTest.testInexistentCheckZipCode(ZipCodeControllerTest.java:80)
Caused by: java.lang.IllegalStateException:
org.springframework.web.context.support.GenericWebApplicationContext#22f3fadf
has been closed already at
com.package.controller.ZipCodeControllerTest.testInexistentCheckZipCode(ZipCodeControllerTest.java:80)
Tests are very similar, basically the common structure is:
#RunWith(SpringRunner.class)
#WebMvcTest(Controller.class)
public class ControllerTest {
private static final String URL_TEMPLATE = ".....";
#Autowired
private MockMvc mvc;
#Autowired
private ObjectMapper mapper;
#MockBean
private Service service;
private CustomParams params;
private CustomRequest request;
#Before
public void init() {
// initialize params and request ...
}
#Test
public void methodOk() throws Exception {
when(service.method(refEq(params))).thenReturn(RESPONSE);
mvc.perform(MockMvcRequestBuilders.post(URL_TEMPLATE)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.content(mapper.writeValueAsString(request)))
.andExpect(status().isOk())
.andExpect(jsonPath(STATUS_MESSAGE_PATH, is(MESSAGE_CODE_OK)))
.andExpect(jsonPath(STATUS_CODE_PATH, is(STATUS_OK.getStatusCode()))));
}
#Test
public void badRequest() throws Exception {
mvc.perform(MockMvcRequestBuilders.post(URL_TEMPLATE))
.andExpect(status().isBadRequest())
.andExpect(jsonPath(ERROR_MESSAGE_PATH).isNotEmpty());
}
Controllers have a structure like the following:
#RestController
public class Controller {
private Service service;
#PostMapping(value = "/api/some-url", produces = {"application/json"})
public ResponseEntity<CustomResponse> method(
#RequestHeader("someheaders") Integer someHeaders,
#RequestBody CustomRequest someBody) {
CustomParams params = new CustomParams();
params.setApplicationType(applicationType);
params.someHeaders(someHeaders);
return service.method(params);
}
I can't understand the reason of the exceptions and the fact that they occur in different tests in each run.
I've changed classes and variable's names due to confidentiality.
You should use DirtiesContext annotation on your tests. This will assure you'll get clean context on each test and they will not not interfere with eachother
1.When using #ServerEndpoint, Junit does not work,the websocket config as list,when #ServerEndpoint is commend out, junit works well
#ServerEndpoint(value = "/websocket", configurator = SessionForWebSocket.class)
#Component
public class WebSocketBean {
....
}
2. myjunit config is
#RunWith(SpringJUnit4ClassRunner.class)
#SpringBootTest(classes = HdConsumerApplication.class)
#WebAppConfiguration
#Transactional
public class HdJunitTest {}
3.when run junit,i got the error:
2017-08-18 21:47:17 INFO [main] org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping - Mapped "{[/env || /env.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-08-18 21:47:17 INFO [main] org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping - Mapped "{[/actuator || /actuator.json],produces=[application/json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint.links()
2017-08-18 21:47:17 INFO [main] org.springframework.web.socket.server.standard.ServerEndpointExporter - Registering #ServerEndpoint class: class net.huadong.tech.msg.WebSocketBean
2017-08-18 21:47:17 INFO [main] org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer -
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-08-18 21:47:17 ERROR [main] org.springframework.boot.SpringApplication - Application startup failed
java.lang.UnsupportedOperationException: MockServerContainer does not support addEndpoint(Class)
at org.springframework.test.context.web.socket.MockServerContainer.addEndpoint(MockServerContainer.java:126)
at org.springframework.web.socket.server.standard.ServerEndpointExporter.registerEndpoint(ServerEndpointExporter.java:145)
at org.springframework.web.socket.server.standard.ServerEndpointExporter.registerEndpoints(ServerEndpointExporter.java:129)`enter code here`
at org.springframework.web.socket.server.standard.ServerEndpointExporter.afterSingletonsInstantiated(ServerEndpointExporter.java:107)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:779)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
4.is anymethod can help me,fix the matter ,or when junit exclude WebSocketBean
I had the same problem, but when I added the following code it solved the problem. Hope it helps you.
#RunWith(SpringRunner.class)
#SpringBootTest(classes = ZplanApplication.class,
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
I use gradle as build tool for a spring boot application and there I am confronted with some strange behavior. Gradle shows more logging-information on explicitly turn test-outputs off as if I do not specify anything at all.
This is quite strange, because a explicit disable-statement should be at least as expressive as no configuration, or shouldn't it?
Example:
If I add the following lines to my build.gradle, I get a by far more verbose logging output on running gradle test:
test{
testLogging {
showStackTraces = false
showStandardStreams = false
showExceptions = false
showCauses = false
events "failed"
exceptionFormat "short"
}
}
EDIT:
I changed it to events = [] as #Peter_Niederwieser suggested. Now nearly all messages disappear, except the following one. Has somebody or other an idea how I can suppress them all? I only want to show the result 34 tests completedand maybe a link to the report.
:backend:test
Download http://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002.pom
Download http://repo1.maven.org/maven2/org/jacoco/org.jacoco.build/0.6.2.201302030002/org.jacoco.build-0.6.2.201302030002.pom
Download http://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002.jar
objc[1360]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
08:50:37.135 [Thread-7] INFO o.s.c.s.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext#228186d4: startup date [Sat Dec 06 08:50:35 CET 2014]; root of context hierarchy
08:50:37.135 [Thread-6] INFO o.s.c.s.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext#4d18a206: startup date [Sat Dec 06 08:50:35 CET 2014]; root of context hierarchy
08:50:37.135 [Thread-5] INFO o.s.c.s.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext#5221dfe5: startup date [Sat Dec 06 08:50:35 CET 2014]; root of context hierarchy
08:50:37.135 [Thread-8] INFO o.s.w.c.s.GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext#5a5fbef7: startup date [Sat Dec 06 08:50:36 CET 2014]; root of context hierarchy
08:50:37.166 [Thread-7] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'
08:50:37.166 [Thread-6] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'
08:50:37.167 [Thread-5] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'
08:50:37.167 [Thread-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'
08:50:37.167 [Thread-7] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#65bad9fe: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,testConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy
08:50:37.168 [Thread-6] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#c355f75: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,testConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy
08:50:37.168 [Thread-5] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#6dd79791: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,testConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy
08:50:37.168 [Thread-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#75a5ec9: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.co ntext.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,testConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy
08:50:37.175 [Thread-7] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'testConfig'
08:50:37.175 [Thread-6] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'testConfig'
08:50:37.176 [Thread-5] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'testConfig'
08:50:37.176 [Thread-8] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'testConfig'
34 tests completed, 9 failed
:backend:test FAILED
The default is events = []. The code above sets events "failed", which will result in more verbose logging (each failed test will be logged individually).