How is defined a spring context?

Viewed 23

I try to set up a unit test with Spring boot and I always have an error about the spring context.

I did not find a page explaining what is the spring context and how it is defined, especially when annotations and a xml file are used. I looked here Add context path to Spring Boot application but it describes more how to define a context than what is a context.

I try "randomly" some tips found on the net, but i would like to use a "rational solution":).

Where can i find a documentation explaining what is the spring context and how it is defined?

1 Answers

I think the best way to start is Springs own documentation on https://spring.io/quickstart

Besides that the guys at https://www.baeldung.com/spring-boot will give you really basic tutorials.

There are also a lot of Spring boot tutorials you can find on youtube

If you run your Spring boot app locally your context root is usually http://localhost:8080 (unless you change your default settings).

If you want to test for example with SpringBootTest you don't have to provide the context url, but you can use only the Rest path ("/your-endpoint")

Related