//application context
ApplicationContext appContext = createNiceMock(ApplicationContext.class);
expect(secMgr.getApplicationContext()).andReturn(appContext).anyTimes();
//master password provider
MasterPasswordProvider masterPasswdProvider = createNiceMock(MasterPasswordProvider.class);
expect(masterPasswdProvider.getName()).andReturn(MasterPasswordProvider.DEFAULT_NAME).anyTimes();
expect(secMgr.listMasterPasswordProviders()).andReturn(
new TreeSet<String>(Arrays.asList(MasterPasswordProvider.DEFAULT_NAME))).anyTimes();
//password validators
PasswordValidator passwdValidator = createNiceMock(PasswordValidator.class);