public void testMethodChainResolution() {
File file = new File(TestConstants.PETCLINIC_SOURCE_LOCATION);
SpringEntityMappings mappings = new SpringEntityMappings(file);
List<ModelField> fields = mappings.getFieldsFromMethodCalls(".getOwner().getLastName()",
new ModelField("Pet", "pet"));
assertTrue(fields.get(0).equals(new ModelField("Pet", "pet")));
assertTrue(fields.get(1).equals(new ModelField("Owner", "owner")));
assertTrue(fields.get(2).equals(new ModelField("String", "lastName")));
fields = mappings.getFieldsFromMethodCalls(".getOwner()",
new ModelField("Pet", "pet"));
assertTrue(fields.get(1).equals(new ModelField("Owner", "owner")));
fields = mappings.getFieldsFromMethodCalls(".getLastName()",
new ModelField("Owner", "owner"));
assertTrue(fields.get(1).equals(new ModelField("String", "lastName")));
}