All Questions
108
questions
2
votes
1
answer
156
views
Spring Boot @Cachebale annotation not working as expected
I'm currently implementing Spring cache for some of our methods in production. It worked well with a REST controller method using @GetMapping, which makes a call to a service method annotated with @...
1
vote
1
answer
705
views
How to mock bean in springboot groovy and spock tests?
This is a spock test using groovy
This is my code
@SpringBootTest
class SrMetricServiceAspectTest extends Specification {
@Autowired
@Qualifier("potentialSrCreation")
private ...
-2
votes
1
answer
52
views
Spring boot ClassCastException to Jackson
I make simple Spring Boot app with MongoDB and face that issue in my controller class:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController'
Caused ...
0
votes
1
answer
161
views
Maven running Groovy integration tests using Spock testcontainers
I need to introduce integration tests into a Maven build for a Spring REST application. These test classes are written in Groovy and extends an abstract base class what is based on spock.lang....
1
vote
1
answer
708
views
How to Ignore Spring boot configuration in the dependency
I am working on test framework application, which is built in groovy, java 8 and springboot framework. Recently, one of the dependencies was upgraded to its latest version.
When I run the tests, the ...
0
votes
1
answer
232
views
Trying to upgrade Groovy app from 2.3.1 to 3.3.15, I am getting lots of errors like below. any help will be appriciated
| Running application...
2022-10-11 17:19:04.189 ERROR --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory....
1
vote
1
answer
386
views
Spring boot upgrade - codehaus gmavenplus-plugin throwing missing dependency javax.servlet.http.HttpUpgradeHandler exception
Our application is built on legacy spring boot 1 and tomcat 7. We have 2 types of test suites - Junits(Java) and Integration Test(Written in Groovy). We use below plugin to compile our groovy tests.
&...
0
votes
1
answer
618
views
Is it posible to make spock specification conditional on property from Spring's application.properties?
Background:
project logic in Java 11 and Spring Boot 2.6.6
some project features are conditionally available depending on specific application properties, some Spring components related with ...
0
votes
1
answer
778
views
Autowired Controller in Spring Boot test is null
I am trying my hand at creating tests for my Spring boot app using Spock/Groovy. I am following a guide, and the first test is to test whether all the beans are created. I auto wired one of my ...
0
votes
0
answers
741
views
E SRVE0777E: Exception thrown by application class 'org.springframework.web.servlet.FrameworkServlet.processRequest:982'
I have deployment my war file in server and it is throwing below exception while running the test case on my server and it is working fine when I ran in local. (On my local server it is not throwing ...
4
votes
1
answer
6k
views
In spring-boot 2.6.2 Could not initialize Logback logging from classpath:logback-spring.groovy
I migrated my spring boot app for spring-boot 2.5.6 to spring-boot 2.6.2, but since then the start up tells
java.lang.IllegalStateException: Could not initialize Logback logging from classpath:logback-...
2
votes
1
answer
4k
views
Getting error "groovy.lang.MissingPropertyException: No such property: response for class: com.school.ClassService
I am getting the below error while reading the data from the rest call
Error:-groovy.lang.MissingPropertyException: No such property: response for class: com.school.ClassService. Although my rest call ...
3
votes
3
answers
10k
views
How to force Spring boot's @RequestBody to accept XML
I have a spring boot application with groovy (jdk 11), I want to accept a xml request body. This is my controller:
@RestController
class UserController {
@PostMapping(path = "/herd", ...
0
votes
1
answer
77
views
SpringBootTest for an arbitrary ApplicationConfiguration class to test the reading of the application.yml file
I would like to learn how to write a SpringBootTest for an existing ApplicationConfiguration class for the purpose of testing the functionality of reading the application.yml file. I would be happy ...
0
votes
1
answer
583
views
Create custom plugin and using it in another buildscript
Trying to create a custom plugin to share the buildscript logic across projects. I have added the buildscript classpath dependencies but it is still saying that the plugin can't be found. I do not ...