Test case failures after transfering PersonAttributeResource1_8 to omod 1.9

hello folks i am working on the ticket [RESTWS-741] - OpenMRS Issues i have run into this issue

@Test public void setValue_shouldSetProperAttributableIdIfFound() { PersonAttributeType type = new PersonAttributeType(); type.setFormat(“org.openmrs.Location”); type.setName(“Second Home”); type.setDescription(“Testing Attributable domain objects”); type.setSortWeight(5.5); type.setSearchable(false); type = personService.savePersonAttributeType(type);

	//Get the first location in from the list
	Location location = locationService.getAllLocations().get(0);
	
	PersonAttribute attribute = new PersonAttribute(type, null);
	attribute.setAttributeType(type);
	
	Assert.assertNull(attribute.getValue());
	
	resource.setValue(attribute, location.getUuid());
	
	Assert.assertEquals(location.getUuid(), attribute.getValue());
}

the above test in particular fails when the person attribute 1_8 resourse in transfered in to omod 1.9 i tried to compare the two omods to see if there is any differnces in the dependecies, i find non i believe ther must be a change made in 1.9 the i need to foreseeto make this test work

i request for more asistance on understanding this issue cc. @ibacher @dkayiwa @ruhanga

Oddly, I think the test here is wrong and the behaviour we’re getting is the expected result.

oh okay but why if we run in it omod 1.8 thethat specific test pass thats what beats my understanding

so do you suggest we modify it to match the expected result with the actual result, will that serve the purpose or we ignore the test all together @ibacher

plus just another quick one while at this issue, PersonAttributeTypeResourceWithConcept1_8Test which also is related to the PersonAttributeResource (it’s casted in BaseDelegatingResourceTest which is extend by this class). it invokes a java.lang.ClassCastException

java.lang.ClassCastException: org.openmrs.module.webservices.rest.SimpleObject cannot be cast to org.openmrs.Concept

  • i thought the SimpleOject class treats concepts as objects
  • also if we were to run this test in the omod 1.8 it would pass

Is there any solution for this also this are the only issues i find in the resource folder everything else perfectly fine

cc. @ibacher @dkayiwa @ruhanga

please let me know how to deal with these two test classes