From external contributors
Unless I'm missing something, custom implementations of SerializationCustomSerializer are not usable in either MockNetwork or net.corda.testing.driver tests, if at all.
I have applied the documentation instructions on a cordapp-template-kotlin fork to create a simple test-case that can be found here. The test only covers MockNetwork but should be enough to (in)validate the issue.
The contract module tests will fail with
java.io.NotSerializableException: Class "class com.template.states.NonSerializable" is not on the whitelist or annotated with @CordaSerializable.
but it's worth noting this is not just about the serializer failing to (implicitly) add NonSerializable to the whitelist. If the latter is annotated with @CordaSerializable the test passes, but NonSerializableSerializer is never called.