LegacyDataAdapterImpl implements LegacyDataAdapter { @Override public boolean hasPrimaryKeyFieldValues(Object dataObject) { return selectAdapter(dataObject).hasPrimaryKeyFieldValues(dataObject); }  @Override T save(T dataObject); @Override T linkAndSave(T dataObject); @Override T saveDocument(T document); @Override T findByPrimaryKey(Class<T> clazz, Map<String, ?> primaryKeys); @Override T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey); @Override void delete(Object dataObject); @Override void deleteMatching(Class<?> type, Map<String, ?> fieldValues); @Override T retrieve(T dataObject); @Override Collection<T> findAll(Class<T> clazz); @Override Collection<T> findMatching(Class<T> clazz, Map<String, ?> fieldValues); @Override Collection<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField,
            boolean sortAscending); @Override Map<String, ?> getPrimaryKeyFieldValues(Object dataObject); @Override void retrieveNonKeyFields(Object persistableObject); @Override void retrieveReferenceObject(Object persistableObject, String referenceObjectName); @Override void refreshAllNonUpdatingReferences(Object persistableObject); @Override boolean isProxied(Object object); @Override Object resolveProxy(Object object); @Override Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties,
            boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit); @Override Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties,
            List<String> wildcardAsLiteralPropertyNames, boolean unbounded,
            boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit); @Override T findObjectBySearch(Class<T> type, Map<String, String> formProps); @Override boolean allPrimaryKeyValuesPresentAndNotWildcard(Class<?> boClass, Map<String, String> formProps); @Override List<String> listPrimaryKeyFieldNames(Class<?> type); @Override Class<?> determineCollectionObjectType(Class<?> containingType, String collectionPropertyName); @Override boolean hasReference(Class<?> boClass, String referenceName); @Override boolean hasCollection(Class<?> boClass, String collectionName); @Override boolean isExtensionAttribute(Class<?> boClass, String attributePropertyName, Class<?> propertyType); @Override Class<?> getExtensionAttributeClass(Class<?> boClass, String attributePropertyName); @Override Map<String, ?> getPrimaryKeyFieldValuesDOMDS(Object dataObject); @Override boolean equalsByPrimaryKeys(Object do1, Object do2); @Override void materializeAllSubObjects(Object object); @Override Class<?> getPropertyType(Object object, String propertyName); @Override Object getExtension(
            Class<?> businessObjectClass); @Override void refreshReferenceObject(Object businessObject, String referenceObjectName); @Override boolean isLockable(Object object); @Override void verifyVersionNumber(Object dataObject); @Override RemotableQuickFinder.Builder createQuickFinder(Class<?> containingClass, String attributeName); @Override boolean isReferenceUpdatable(Class<?> type, String referenceName); @Override @SuppressWarnings("rawtypes") Map<String, Class> listReferenceObjectFields(Class<?> type); @Override boolean isCollectionUpdatable(Class<?> type, String collectionName); @Override @SuppressWarnings("rawtypes") Map<String, Class> listCollectionObjectTypes(Class<?> type); @Override Object getReferenceIfExists(Object bo, String referenceName); @Override boolean allForeignKeyValuesPopulatedForReference(Object bo, String referenceName); @Override RelationshipDefinition getDictionaryRelationship(Class<?> c, String attributeName); @Override String getTitleAttribute(Class<?> dataObjectClass); @Override boolean areNotesSupported(Class<?> dataObjectClass); @Override String getDataObjectIdentifierString(Object dataObject); @Override Class<?> getInquiryObjectClassIfNotTitle(Object dataObject, String propertyName); @Override Map<String, String> getInquiryParameters(Object dataObject, List<String> keys, String propertyName); @Override boolean hasLocalLookup(Class<?> dataObjectClass); @Override boolean hasLocalInquiry(Class<?> dataObjectClass); @Override org.kuali.rice.krad.bo.DataObjectRelationship getDataObjectRelationship(Object dataObject,
            Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly,
            boolean supportsLookup, boolean supportsInquiry); @Override boolean isPersistable(Class<?> dataObjectClass); @Override ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(Object dataObject, String referenceName); @Override Map<String, String> getForeignKeysForReference(Class<?> clazz, String attributeName); @Override boolean hasPrimaryKeyFieldValues(Object dataObject); @Override void setObjectPropertyDeep(Object bo, String propertyName, Class type,
            Object propertyValue); @Override @SuppressWarnings("rawtypes") Class materializeClassForProxiedObject(Object object); @Override Object getNestedValue(Object bo, String fieldName); @Override @SuppressWarnings("rawtypes") Object createNewObjectFromClass(Class clazz); @Override boolean isNull(Object object); @Override void setObjectProperty(Object bo, String propertyName, Class propertyType,
            Object propertyValue); @Override T findByDocumentHeaderId(Class<T> documentClass, String id); @Override List<T> findByDocumentHeaderIds(Class<T> documentClass, List<String> ids); LegacyDataAdapter getKradLegacyDataAdapter(); void setKradLegacyDataAdapter(LegacyDataAdapter kradLegacyDataAdapter); LegacyDataAdapter getKnsLegacyDataAdapter(); void setKnsLegacyDataAdapter(LegacyDataAdapter knsLegacyDataAdapter);  }
@Test public void testHasPrimaryKeyFieldValues() throws Exception { Object object = newNonLegacyObject(); lda.hasPrimaryKeyFieldValues(object); verify(kradLegacyDataAdapter).hasPrimaryKeyFieldValues(eq(object)); verifyZeroInteractions(knsLegacyDataAdapter); }
@Test public void testHasPrimaryKeyFieldValues_Legacy() throws Exception { enableLegacy(); Object object = newLegacyObject(); lda.hasPrimaryKeyFieldValues(object); verify(knsLegacyDataAdapter).hasPrimaryKeyFieldValues(eq(object)); verifyZeroInteractions(kradLegacyDataAdapter); }