hilla icon indicating copy to clipboard operation
hilla copied to clipboard

PiT 24.4: EndpointControllerConfiguration makes Spring boot based tests fail

Open manolo opened this issue 1 year ago • 0 comments

Describe the bug

When upgrading to version 24.4.0.alpha3 the demo project hosted in spring project fails when running tests

I have tried to add the maven plugin to the build block as described in this issue, but still failing

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method csrfChecker in com.vaadin.hilla.EndpointControllerConfiguration required a bean of type 'jakarta.servlet.ServletContext' that could not be found.


Action:

Consider defining a bean of type 'jakarta.servlet.ServletContext' in your configuration.

Problematic code is here

Expected-behavior

tests pass

Reproduction

## clone project and change to the folder `complete`
git clone https://github.com/spring-guides/gs-crud-with-vaadin.git
cd gs-crud-with-vaadin/complete
## Increase version
perl -0777 -pi -e 's|(<vaadin.version>)([^\s]+)(</vaadin.version>)|${1}24.4.0.alpha8${3}|g' pom.xml

## Add prereleases repositories
perl -pi -e  \
  's|(\s*)(</properties>)|$1$2\n$1<repositories><repository><id>v</id><url>https://maven.vaadin.com/vaadin-prereleases</url></repository></repositories>|' \
  pom.xml

perl -pi -e \
  's|(\s*)(</properties>)|$1$2\n$1<pluginRepositories><pluginRepository><id>v</id><url>https://maven.vaadin.com/vaadin-prereleases</url></pluginRepository></pluginRepositories>|' \
  pom.xml

## Run tests
mvn clean test

System Info

Vaadin 24.4.0.alpha3-alpha8

manolo avatar Feb 12 '24 22:02 manolo