FormEntryViewModel extends ViewModel implements RequiresFormController { public void cancelRepeatPrompt() { if (formController == null) { return; } if (jumpBackIndex != null) { analytics.logEvent(ADD_REPEAT, "InlineDecline", formController.getCurrentFormIdentifierHash()); formController.jumpToIndex(jumpBackIndex); jumpBackIndex = null; } else { try { this.formController.stepToNextScreenEvent(); } catch (JavaRosaException exception) { error.setValue(exception.getCause().getMessage()); } } } @SuppressWarnings("WeakerAccess")  FormEntryViewModel(Analytics analytics); @Override void formLoaded(@NotNull FormController formController); @Nullable FormIndex getCurrentIndex(); LiveData<String> getError(); @SuppressWarnings("WeakerAccess") void promptForNewRepeat(); void jumpToNewRepeat(); void addRepeat(boolean fromPrompt); void cancelRepeatPrompt(); void errorDisplayed(); boolean canAddRepeat();  }
@Test public void cancelRepeatPrompt_doesNotLogInlineDeclineAnalytics() { viewModel.cancelRepeatPrompt(); verify(analytics, never()).logEvent(AnalyticsEvents.ADD_REPEAT, "InlineDecline", "formIdentifierHash"); }