mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Make Router reject classes with no @Action-returning methods
This provides a safeguard against using TypeInstantiator to resolve the component class, where if resolution is done incorrectly, you end up with java.lang.Object. Formerly, that would have "succeeded" in generating a Router for Object, which of course has no methods that return @Action classes. Such a router is pretty useless, so it's better to make Router stricter and have it fail if you give it such a class by accident. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148353224
This commit is contained in:
parent
d8ce444251
commit
ea3a8dfa9d
3 changed files with 19 additions and 10 deletions
|
@ -363,6 +363,7 @@ public final class RequestHandlerTest {
|
|||
@Test
|
||||
public void testNullness() {
|
||||
NullPointerTester tester = new NullPointerTester();
|
||||
tester.setDefault(Class.class, Component.class);
|
||||
tester.setDefault(RequestAuthenticator.class, requestAuthenticator);
|
||||
tester.setDefault(XsrfTokenManager.class, xsrfTokenManager);
|
||||
tester.testAllPublicStaticMethods(RequestHandler.class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue