UserImpl extends AuthorizableImpl implements User { @Override public void disable(@Nullable String msg) throws RepositoryException { try { getDelegate().disable(msg); } finally { getMgr().autosave(); } } UserImpl(User dlg, AutoSaveEnabledManager mgr); @Override boolean isAdmin(); @Override boolean isSystemUser(); @NotNull @Override Credentials getCredentials(); @NotNull @Override Impersonation getImpersonation(); @Override void changePassword(@Nullable String pw); @Override void changePassword(@Nullable String pw, @NotNull String oldPw); @Override void disable(@Nullable String msg); @Override boolean isDisabled(); @Nullable @Override String getDisabledReason();  }
@Test public void testDisable() throws Exception { user.disable("disable"); verify(dlg, times(1)).disable("disable"); verify(autosaveMgr, times(1)).autosave(); }