/** * Creates a new Instance * * @param service * @throws IOException */ public static DecodingUserDetailsService newInstance(GeoServerUserGroupService service) throws IOException { DecodingUserDetailsService decodingService = new DecodingUserDetailsService(); decodingService.setGeoserverUserGroupService(service); return decodingService; }
@Test public void testDecodingUserDetailsService() throws Exception { GeoServerUserGroupService service = createUserGroupService("test"); DecodingUserDetailsService decService = DecodingUserDetailsService.newInstance(service); GeoServerUserGroupStore store = createStore(service); insertValues(store); store.store(); String plainpassword = "geoserver"; UserDetails admin = service.loadUserByUsername(GeoServerUser.ADMIN_USERNAME); assertFalse(plainpassword.equals(admin.getPassword())); UserDetails admin2 = decService.loadUserByUsername(GeoServerUser.ADMIN_USERNAME); assertTrue(plainpassword.equals(admin2.getPassword())); }