AnimatorWrapper extends Animator { @Override public boolean isRunning() { return animator.isRunning(); } AnimatorWrapper(@NonNull final Animator animator); @NonNull final Animator getWrappedAnimator(); void requestFeatures(@WrapperFeatures final int features); void requestFeature(@WrapperFeatures final int feature); void removeFeature(@WrapperFeatures final int feature); boolean hasFeature(@WrapperFeatures final int feature); @Override void addListener(@NonNull final AnimatorListener listener); @Override void removeListener(@NonNull final AnimatorListener listener); @Override void addPauseListener(@NonNull final AnimatorPauseListener listener); @Override void removePauseListener(@NonNull final AnimatorPauseListener listener); @Override @NonNull ArrayList<AnimatorListener> getListeners(); @Override void removeAllListeners(); @Override void setStartDelay(final long startDelay); @Override long getStartDelay(); @Override Animator setDuration(final long duration); @Override long getDuration(); @Override void setInterpolator(@Nullable final TimeInterpolator interpolator); @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @Override TimeInterpolator getInterpolator(); @Override void setTarget(@Nullable final Object target); @Override void start(); @Override boolean isStarted(); @Override void pause(); @Override boolean isPaused(); @Override void resume(); @Override void end(); @Override void cancel(); @Override boolean isRunning(); static final int START; static final int PAUSE; static final int RESUME; static final int END; static final int CANCEL; static final int ALL; }
@Test public void testIsRunning() { final Animator mockAnimator = mock(Animator.class); final AnimatorWrapper wrapper = new AnimatorWrapper(mockAnimator); when(mockAnimator.isRunning()).thenReturn(true); assertThat(wrapper.isRunning(), is(true)); verify(mockAnimator).isRunning(); }