Add unit test for injection of context subclasses

This will help prevent regressions relating to the bug-fix in
fbd648585ffae96f2b33305def9f6fbb7546cd4e.
ContextInjectionTest: add missing final keywords