org.openmrs.module.webservices.rest.web.response.ConversionException

module
Tags: #<Tag:0x00007f88c95d5080>

(Shujaat Ali) #1

I try to create/save a LabTestAttribute it throws a ConversionException exception. I am writing a unit test for one of our module named as common lab test module. Before going on the issue I will let know the structure of module code.

Entity https://pastebin.com/ZGH2Tf18

ResourceController https://pastebin.com/8LQSgbRj

Test Case https://pastebin.com/vb3ijaEK

Hibernate File https://pastebin.com/mgh5az5M

Exceptions https://pastebin.com/sFBiFdCa


(Nathan Ruhanga) #2

@shujaat, there is probably missing a @PropertyGetter annotated method for the property valueReference that you added. You may need to provide this method depending on your use case to silence this error.


(Shujaat Ali) #3

@ruhanga, in openmrs BaseAttribute class we have the setter and getter for valueReference property, Take a look at the BaseAttribute Abstract Class https://pastebin.com/x48RTGi0.


(Daniel Kayiwa) #4

Is this the full stack trace?


(Shujaat Ali) #5

Yes @dkayiwa !


(Daniel Kayiwa) #6

Can you commit your changes to a repository from where we can check out?


(Shujaat Ali) #7

please checkout the master branch https://github.com/seekme94/openmrs-module-commonlabtest


(Daniel Kayiwa) #8

Can you add these to the resource? https://pastebin.com/MaKaehPG


(Shujaat Ali) #9

Okay, let me add this @PropertyGetter /@PropertySetter for value.


(Owais Hussain) #10

Thanks a bunch @dkayiwa, these methods as is didn’t work, but I got the point. We needed to explicitly define PropertyGetter/Setter to handle value in this case.

@shujaat please check this commit…