Update object private property with groovy Posted on 03 November 2017 at 09:42.Written by Mustafa Kerim Yılmaz You can update private field an object with below sample code. def myBean = spring.getBean("myBean"); def f = myBean.getClass().getDeclaredField("myField"); f.setAccessible(true); f.set(myBean, "new string value");
Leave a Reply