AssetManager { @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread public void onFinish(@NonNull String scheduleId) { assetCache.releaseAssets(scheduleId, true); } @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  AssetManager(@NonNull Context context); @VisibleForTesting  AssetManager(@NonNull AssetCache assetCache); void setPrepareAssetDelegate(@Nullable PrepareAssetsDelegate assetsDelegate); void setCachePolicyDelegate(@Nullable CachePolicyDelegate cachePolicyDelegate); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread void onSchedule(@NonNull String scheduleId, @NonNull Callable<InAppMessage> extendedMessageCallable); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread @PrepareResult int onPrepare(@NonNull String scheduleId, @NonNull InAppMessage message); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread void onDisplayFinished(@NonNull String scheduleId, @NonNull InAppMessage inAppMessage); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @WorkerThread void onFinish(@NonNull String scheduleId); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @NonNull Assets getAssets(@NonNull String scheduleId); static final int PREPARE_RESULT_OK; static final int PREPARE_RESULT_RETRY; static final int PREPARE_RESULT_CANCEL; }
@Test public void testClearOnScheduleFinished() { assetManager.onFinish("some-id"); verify(mockCache).releaseAssets("some-id", true); }