Hallo friends… i have been working on TICKET DPLY-40 and Finished replacing SessionFactory/Session instances with DbSessionFactory / DbSession instances for purposes of backwards compatibility with openmrs versions less than 2.x.
When i run mvn clean install -DskipTests, builds are successful ,however when i include tests,builds fail,causes by en error in metadatadeploy.MetadataUtilsTest Tests in error:
getLocation_shouldFetchByUuid(org.openmrs.module.metadatadeploy.MetadataUtilsTest): No such Location with identifier 'dc5c1fcc-0459-4201-bf70-0b90535ba362
I suggest that you check out the status of the location table during the tests. E.g. if that location is actually not in the table then you need to figure out why it’s not there after making your changes.
I would do this by putting a breakpoint somewhere in the test and inspecting things with your IDEs debugger. (But you could also do it by adding a lot of log.debug statements.)
Herer, you can simply use with REST API to confirm that location object exists in the system. Try this following URL in your browser simply and check the output!
Let me also ask this, making that rest call, would it not be directing me to the system database? I found .csv sample data file shipped with the module…i came across /metadatadeploy-api/src/test/resources/test-location-source.csv with the following contents…
Not sure this will work. He’s still building the project and does not use a deployed server. During test execution database tables are built from dataset files.
Can you confirm that this test passes without your changes? For that you can just checkout master and do
mvn clean install. If you are developing on master then you have to checkout a new branch and revert the branch to the first commit below your own and do mvn clean install. If the test passes while doing the above then the location is actually present but something in your code might be making it unavailable at the time of running the test.
To verify that I’ll advice you place breakpoints in your code as @darius suggested. With Intelij Idea you even place breakpoints in code that is not available. That is if your code uses api binaries you can still place breakpoints in them.