I've been banging my head on this for about a week straight now and can't figure out why this is happening.
I'm using the latest stable version of the testrail-api-java (1.0.1) in a mavenized java 1.8 project with the latest Selenium and TestNG.
I'm attempting to update a test run with the results of a test using the following code:
List<ResultField> customResultField = testRail.resultFields().list().execute();
testRail.results().addForCase(testRun.getId(), testId, new Result().setStatusId(testStatus), customResultField).execute();
The update was failing with a RuntimeException:
com.fasterxml.jackson.databind.JsonMappingException: Failed to getValue() with method com.codepine.api.testrail.model.Result#getCustomFields(0 params): null (through reference chain: com.codepine.api.testrail.model.Result["[anySetter]"])
I debugged the code and noticed that this exception occurs and is caught during the attempted update of the run:
Method threw 'java.lang.NoSuchMethodError' exception. Cannot evaluate com.codepine.api.testrail.model.Result.toString()
This appears to be an issue with the override of the base java util toString() method.
During debugging I checked for obvious things like null variables, scope issues, etc but wasn't able to really nail down why this is happening.
My java knowledge is prob novice at best as I'm self-taught so I apologize if this is obvious and not an actual issue with this library.
Any help would be greatly appreciated as I've tried literally everything I can think of.
UPDATE: I updated my pom to refer to version 1.0.2 in case I was mistaken about which version was stable and the exception still occurs.
UPDATE: A java developer thought it could be a Lombok issue and suggested adding Lombok to my classpath, the exception still occurs regardless.
I've reached out to the Git community for the library I'm using but haven't received a response at this time. Link to issue posting (duplicate info) on the project's Github page: https://github.com/codepine/testrail-api-java-client/issues/14