createStrongPbePasswordEncoder(secMgr), createDigestPasswordEncoder(secMgr));
}
}).anyTimes();
//keystore provider
KeyStoreProvider keyStoreProvider = createNiceMock(KeyStoreProvider.class);
expect(keyStoreProvider.isKeyStorePassword(aryEq("geoserver".toCharArray())))
.andReturn(true).anyTimes();
expect(keyStoreProvider.containsAlias(KeyStoreProviderImpl.CONFIGPASSWORDKEY))
.andReturn(true).anyTimes();;
expect(keyStoreProvider.getSecretKey(KeyStoreProviderImpl.CONFIGPASSWORDKEY))
.andReturn(new SecretKeySpec(toBytes("geoserver".toCharArray()),"PBE")).anyTimes();
expect(keyStoreProvider.hasUserGroupKey(XMLUserGroupService.DEFAULT_NAME))
.andReturn(true).anyTimes();
String alias = "ugServiceAlias";
expect(keyStoreProvider.aliasForGroupService(XMLUserGroupService.DEFAULT_NAME))
.andReturn(alias).anyTimes();
expect(keyStoreProvider.containsAlias(alias)).andReturn(true).anyTimes();;
expect(keyStoreProvider.getSecretKey(alias)).andReturn(
new SecretKeySpec(toBytes("geoserver".toCharArray()),"PBE")).anyTimes();
expect(secMgr.getKeyStoreProvider()).andReturn(keyStoreProvider).anyTimes();
replay(keyStoreProvider, masterPasswdProvider, ugStore, ugConfig, roleStore, authProvider,
authProviderConfig, filterConfig, passwdValidator, masterPasswdPolicyConfig, appContext,