Class<? extends ValueHandler> handler) {
FieldMapping fmd = getFieldMapping(pcClass, field);
FieldStrategy actualStrategy = ((FieldMapping) fmd).getStrategy();
assertEquals(strategy, actualStrategy.getClass());
ValueHandler actualHandler = fmd.getHandler();
if (handler == null) {
if (actualHandler != null) {
printMapping(fmd);
fail("Expected no value handler for " + pcClass.getName() + "." + field +
" but found " + actualHandler);
}
} else {
if (actualHandler == null) {
printMapping(fmd);
fail("Expected a value handler for " + pcClass.getName() + "." + field + " but found null");
}
if (!handler.getClass().equals(actualHandler.getClass())) {
printMapping(fmd);
assertEquals(handler, fmd.getHandler().getClass());
}
}
}