RestAssured Spring Boot Test returning 404s

412 views Asked by At

I am building an API using Spring Boot and Katharsis. When writing integration tests using RestAssured my tests are passing in STS but getting 404s in Maven. I'm not sure what the difference might be or why it isn't working.

Running the API things are working as expected.

I was wondering if anyone had any thoughts?

Code Repo is here: https://github.com/Holmes89/liturgical-project

1

There are 1 answers

0
Joel Holmes On BEST ANSWER

So the problem had to do with the fact Reflections wasn't populating my ResourcesRepository on test startup. I found a similar problem here:

Unit test using the Reflections google library fails only when executed by Maven

And used the following link to configure the Maven Surefire Plugin:

http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html

Adding the following config helped:

<useSystemClassLoader>false</useSystemClassLoader>