View Javadoc
1   package org.oxerr.commons.ws.rs.bean;
2   
3   import static org.junit.jupiter.api.Assertions.assertEquals;
4   
5   import java.lang.reflect.InvocationTargetException;
6   
7   import org.junit.jupiter.api.Test;
8   
9   class NullAwareBeanUtilsBeanTest {
10  
11  	@Test
12  	void testCopyPropertyObjectStringObjectNull() throws IllegalAccessException, InvocationTargetException {
13  		Bean bean = new Bean();
14  		bean.setF1("value0");
15  
16  		NullAwareBeanUtilsBean.getInstance().copyProperty(bean, "f1", null);
17  
18  		assertEquals("value0", bean.getF1());
19  	}
20  
21  	@Test
22  	void testCopyPropertyObjectStringObject() throws IllegalAccessException, InvocationTargetException {
23  		Bean bean = new Bean();
24  
25  		NullAwareBeanUtilsBean.getInstance().copyProperty(bean, "f1", "value1");
26  
27  		assertEquals("value1", bean.getF1());
28  	}
29  
30  }