mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package cn.hutool.core.bean;
|
||||
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Data;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IssueI80FP4Test {
|
||||
@Test
|
||||
public void copyPropertiesTest() {
|
||||
final Dest sourceDest = new Dest();
|
||||
sourceDest.setCPF(33699);
|
||||
sourceDest.setEnderDest("abc");
|
||||
|
||||
final Dest dest = new Dest();
|
||||
final CopyOptions copyOptions = CopyOptions.create().setIgnoreNullValue(true).setIgnoreCase(true).setIgnoreProperties("enderDest");
|
||||
BeanUtil.copyProperties(sourceDest, dest, copyOptions);
|
||||
Assert.assertNull(dest.getEnderDest());
|
||||
}
|
||||
|
||||
@Data
|
||||
static class Dest{
|
||||
private int cPF;
|
||||
private String enderDest;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user