private Mapping partialMapping() { Mapping mapping = mock(Mapping.class); given(mapping.getOperationMessageAttibute()).willReturn(OPERATION_FIELD_NAME); given(mapping.getOperationForMethod("mappedCall")).willReturn("OP"); given(mapping.getMethodForOperation("OP")).willReturn("mappedCall"); givenFieldMapping(mapping, "s1", FieldMapping.map("a")); return new CheckedMapping(mapping); }
private <T> void givenFieldMapping( Mapping receiveMapping, String attributeName, FieldMapping<T> fieldMapping) { @SuppressWarnings("unchecked") FieldMapping<T> mapping = (FieldMapping<T>) receiveMapping.getMappingForField(attributeName); given(mapping).willReturn(fieldMapping); }