0

I've made a simple Maven Spring REST project. (this one: https://spring.io/guides/gs/rest-service/)

Afterwards I made a simple JUnit test using MockMVC to test the REST functionality. In this case: does my code respond to /greeting?

When I run my test (using IntelliJ) I get this IllegalStateException.

How can I resolve this?

error message

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ricardo
  • 335
  • 1
  • 4
  • 13

1 Answers1

3

You're probably using incompatible versions of spring-test and spring-boot. spring-test calls SpringApplicationContextLoader.getResourceSuffixes (plural form) since v4.1.0.RC2. spring-boot's SpringApplicationContextLoader.getResourceSufffix (singular) throws that exception since v1.3.0.RC1.

You would have to either upgrade to spring-test >= 4.1.0 or downgrade to spring-boot < 1.3.0

Axel von Engel
  • 339
  • 2
  • 5
  • Oh, sorry - spring moved the test classes back into the framework repository. You need to upgrade your spring-test dependency to > 4.1.0 – Axel von Engel Mar 19 '16 at 11:04
  • Okay, I changed that tot 4.2.5. I think that error is resolved. Now, I get a few other errors I don't understand: http://puu.sh/nM1FB/b39002b018.png – Ricardo Mar 19 '16 at 11:12
  • @John if this answer resolved the problem described in your question, it would be nice to upvote + accept this answer, and ask a completely new question with the next problems you're experiencing – janos Mar 19 '16 at 23:05