ScheduleAction extends Action { @Override public boolean acceptsArguments(@NonNull ActionArguments arguments) { switch (arguments.getSituation()) { case Action.SITUATION_MANUAL_INVOCATION: case Action.SITUATION_WEB_VIEW_INVOCATION: case Action.SITUATION_PUSH_RECEIVED: case Action.SITUATION_AUTOMATION: return arguments.getValue().toJsonValue().isJsonMap(); case Action.SITUATION_BACKGROUND_NOTIFICATION_ACTION_BUTTON: case Action.SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON: case Action.SITUATION_PUSH_OPENED: default: return false; } } ScheduleAction(); @VisibleForTesting  ScheduleAction(@NonNull Callable<InAppAutomation> actionAutomationCallable); @Override boolean acceptsArguments(@NonNull ActionArguments arguments); @NonNull @Override ActionResult perform(@NonNull ActionArguments arguments); @NonNull
    static final String DEFAULT_REGISTRY_NAME; @NonNull
    static final String DEFAULT_REGISTRY_SHORT_NAME; }
@Test public void testAcceptsArguments() { for (@Action.Situation int situation : acceptedSituations) { ActionArguments args = createArgs(situation, scheduleJson); assertTrue("Should accept arguments in situation " + situation, action.acceptsArguments(args)); } for (@Action.Situation int situation : rejectedSituations) { ActionArguments args = createArgs(situation, scheduleJson); assertFalse("Should reject arguments in situation " + situation, action.acceptsArguments(args)); } }