You're using a mapper to map from a UUID to another UUID? Shouldn't you be testing that you can map a UUID from class A to class B? When you map the UUID directly, dozer is going to reflectively inspect the fields inside the UUID and try to copy them from one to another.
In other words, I don't think this test is valid. This test passed for me (it needed the configuration you added):
@Test
public void whenMappingAUuidThenItGetsCopiedByReference() {
ClassWithUuid a = new ClassWithUuid();
UUID uuid = UUID.randomUUID();
a.setUuid(uuid);
Mapper mapper = new Mapper();
ClassWithUuid b = //map to b
assertEquals(uuid, b.getUuid());
}
public static class ClassWithUuid {
private UUID uuid;
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
}