MessageCenterAction extends Action { @Override public boolean acceptsArguments(@NonNull ActionArguments arguments) { switch (arguments.getSituation()) { case SITUATION_PUSH_OPENED: case SITUATION_WEB_VIEW_INVOCATION: case SITUATION_MANUAL_INVOCATION: case SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON: case SITUATION_AUTOMATION: return true; case SITUATION_BACKGROUND_NOTIFICATION_ACTION_BUTTON: case SITUATION_PUSH_RECEIVED: default: return false; } } MessageCenterAction(); @VisibleForTesting  MessageCenterAction(@NonNull Callable<MessageCenter>  messageCenterCallable); @Override boolean acceptsArguments(@NonNull ActionArguments arguments); @NonNull @Override ActionResult perform(@NonNull ActionArguments arguments); @Override boolean shouldRunOnMainThread(); @NonNull
    static final String DEFAULT_REGISTRY_NAME; @NonNull
    static final String DEFAULT_REGISTRY_SHORT_NAME; @NonNull
    static final String MESSAGE_ID_PLACEHOLDER; }
@Test public void testAcceptsArguments() { @Action.Situation int[] situations = new int[] { Action.SITUATION_PUSH_OPENED, Action.SITUATION_MANUAL_INVOCATION, Action.SITUATION_WEB_VIEW_INVOCATION, Action.SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON, Action.SITUATION_AUTOMATION }; for (@Action.Situation int situation : situations) { ActionArguments args = createArgs(situation, null); assertTrue("Should accept arguments in situation " + situation, action.acceptsArguments(args)); } for (@Action.Situation int situation : situations) { ActionArguments args = createArgs(situation, "message_id"); assertTrue("Should accept arguments in situation " + situation, action.acceptsArguments(args)); } }