@dkayiwa I wonder if you could have a look at this quickly. I stumbled upon this in Attachments and perhaps something is misconfigured somewhere…
Look at this test in Attachments. It an API test (located in api/) and if you attempt to extend BaseModuleContextSensitiveTest (rather than the current BaseModuleWebContextSensitiveTest), you get this:
No matching bean of type
[org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]
This bean is defined in Core’s openmrs-servlet.xml (here) and indeed only BaseModuleWebContextSensitiveTest is grasping that (see here).
Is this a known issue (the problem seems to go away from 1.11.x) or did I miss something?
I think it comes down to what ImageAttachmentHandlerContextSensitiveTest is testing, if the functionality it’s testing is in the web layer then it shouldn’t be in the api sub project in the first place and it should extend BaseModuleWebContextSensitiveTest
Actually Daniel makes a good point, having web dependencies i.e. this and this must be the problem, you should never have web dependencies in the api otherwise that’s what happens.
Clearly some initial (not so well thought through) copy/paste is still lingering in the api/pom.xml. Removing the undesired web dependencies indeed solves the issue.
This is taking me into some more refactoring but nothing major I think. I’ll push that soon on master.