RestAssured Spring Boot Test returning 404s - maven

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

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>

Related

Making a spring boot fat jar file with gradle WITHOUT a spring boot gradle plug-in (no access to bootJar)

I have a spring-boot application in which I loaded all the necessary (or so I believe) dependencies to run without using spring-boot initializer or the spring-boot gradle plug-in. These tools are not available for me at my work. I can run the application through intellij without issues, but when attempting to run a fat jar, I am met with
No auto configuration classes found in META-INF/spring.factories.
Now the spring.factory files ARE located inside the fat jar (there are multiples of them) and they are inside the meta-inf directory.
Spring boot has so much automated functionality, I am not sure where to begin. There are a lot of similar posts and everyone just tells people to use the spring-boot gradle plugin bootJar task but as I said these are not available to me. I need to get it running without those tools,
if anyone has insight into what the issue may be or how to resolve it, any help is appreciated. I will try to add more details later.
I am using spring-boot v. 2.1.1 and spring 5.1.4

Adding a gatling test to a Spring Boot gradle project on IntelliJ

I have a Spring Boot 2 application written in Kotlin (could be Java). The project uses gradle (not maven). The application exposes HTTP endpoints that I want to load test using gatling.
I created a MySimulation.scala file under src/test/gatling. IntelliJ suggested and I accepted the intallation of the Scala IntelliJ plugin. So, I got syntax highliting on the scala editor. :^)
I'd like to have code assist (drill down, code completion) for the scala gatling tests.
What other tools/plugins/configuration do I need to add?
(I have the gatling bundle already installed on my computer. IntelliJ version is 2018.2.4.)

running integration tests in teamcity using spring-boot and restassured

I am writing my integration tests using springboot and rest-assured and using SpringApplicationConfiguration to load the configuration.
This is what the test class annotation look like:
#RunWith(SpringJUnit4ClassRunner.class)
#SpringApplicationConfiguration(classes = RestAPIApplication.class)
#IntegrationTest("server.port:8083") // this is the port set by my application
Now comes my real question. When I run the test class in teamcity using maven, don't I have to configure something to run the springboot server before running the integration tests?
I am new to springboot so maybe this question is very novice but please point me to the correct path.
If you're using embedded tomcat, no extra setup is needed-- simply run the maven tests.

Using spring loaded with spring boot and maven

I'm creating an extremely simple Spring example as described here: http://spring.io/guides/gs/rest-service/ and I'm running it with mvn spring-boot:run. Now I want to add Spring Loaded plugin in there so that I as soon as I compile a java file, it should be compiled and reloaded. Hewever,
I don't want to use Gradle
I don't want to use Eclipse or Idea
Is there a simple way to set up Spring Loaded in Maven so that I can use it from command line?
You just have to add the springloaded jar as a dependency in the plugin configuration, e.g. as in the JPA sample.
Here's a link to the plugin docs: http://docs.spring.io/autorepo/docs/spring-boot/current/maven-plugin/run-mojo.html#agent

RepositorySystemSession Null in Maven 3 Plugin Unit Test

I am attempting to write a unit test for a Maven 3 Plugin with a dependency on Aether using the Maven Plugin Testing Harness. When executing my tests though the RepositorySystemSession is null and after an extensive search I can not figure out how to inject a session into the unit tests plugin harness.
I am using Maven 3.0.3 core APIs, Maven Plugin Test Harness 2.0 and Aether 1.12. I have tried other various combinations but appear to be missing a critical component somewhere along the line.
The code base for the example can be found here: http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/.
The documentation for the plugin harness can be found here: http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html.
My example code can be seen here:
MyAetherMojo
MyAetherMojoTest
Any ideas on how to get the RepositorySystemSession injected into the container for the unit test?
TIA,
Scott ES
The plugin testing harness does not support Aether testing. You have to use the Maven Invoker Plugin as demonstrated in the How To Use Aether in Maven Plugins demo code.

Resources