@Test
public void test() {
List<OmAreaBean> list = new ArrayList<OmAreaBean>();
OmAreaBean bean1 = new OmAreaBean();
bean1.setAreaId(1);
bean1.setAreaCode("10");
bean1.setAreaName("广东省");
bean1.setParntAreaId(0);
bean1.setAreaDesc("广东省");
bean1.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean1);
OmAreaBean bean2 = new OmAreaBean();
bean2.setAreaId(200);
bean2.setAreaCode("11");
bean2.setAreaName("广州");
bean2.setParntAreaId(1);
bean2.setAreaDesc("广州");
bean2.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean2);
OmAreaBean bean3 = new OmAreaBean();
bean3.setAreaId(755);
bean3.setAreaCode("12");
bean3.setAreaName("深圳");
bean3.setParntAreaId(1);
bean3.setAreaDesc("深圳");
bean3.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean3);
OmAreaBean bean4 = new OmAreaBean();
bean4.setAreaId(769);
bean4.setAreaCode("13");
bean4.setAreaName("东莞");
bean4.setParntAreaId(1);
bean4.setAreaDesc("东莞");
bean4.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean4);
OmAreaBean bean5 = new OmAreaBean();
bean5.setAreaId(757);
bean5.setAreaCode("15");
bean5.setAreaName("佛山");
bean5.setParntAreaId(1);
bean5.setAreaDesc("佛山");
bean5.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean5);
OmAreaBean bean6 = new OmAreaBean();
bean6.setAreaId(760);
bean6.setAreaCode("16");
bean6.setAreaName("中山");
bean6.setParntAreaId(1);
bean6.setAreaDesc("中山");
bean6.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean6);
OmAreaBean bean7 = new OmAreaBean();
bean7.setAreaId(752);
bean7.setAreaCode("17");
bean7.setAreaName("惠州");
bean7.setParntAreaId(1);
bean7.setAreaDesc("惠州");
bean7.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean7);
OmAreaBean bean8 = new OmAreaBean();
bean8.setAreaId(754);
bean8.setAreaCode("18");
bean8.setAreaName("汕头");
bean8.setParntAreaId(1);
bean8.setAreaDesc("汕头");
bean8.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean8);
OmAreaBean bean9 = new OmAreaBean();
bean9.setAreaId(750);
bean9.setAreaCode("19");
bean9.setAreaName("江门");
bean9.setParntAreaId(1);
bean9.setAreaDesc("江门");
bean9.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean9);
OmAreaBean bean10 = new OmAreaBean();
bean10.setAreaId(756);
bean10.setAreaCode("20");
bean10.setAreaName("珠海");
bean10.setParntAreaId(1);
bean10.setAreaDesc("珠海");
bean10.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean10);
OmAreaBean bean11 = new OmAreaBean();
bean11.setAreaId(663);
bean11.setAreaCode("21");
bean11.setAreaName("揭阳");
bean11.setParntAreaId(1);
bean11.setAreaDesc("揭阳");
bean11.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean11);
OmAreaBean bean12 = new OmAreaBean();
bean12.setAreaId(759);
bean12.setAreaCode("22");
bean12.setAreaName("湛江");
bean12.setParntAreaId(1);
bean12.setAreaDesc("湛江");
bean12.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean12);
OmAreaBean bean13 = new OmAreaBean();
bean13.setAreaId(668);
bean13.setAreaCode("23");
bean13.setAreaName("茂名");
bean13.setParntAreaId(1);
bean13.setAreaDesc("茂名");
bean13.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean13);
OmAreaBean bean14 = new OmAreaBean();
bean14.setAreaId(758);
bean14.setAreaCode("25");
bean14.setAreaName("肇庆");
bean14.setParntAreaId(1);
bean14.setAreaDesc("肇庆");
bean14.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean14);
OmAreaBean bean15 = new OmAreaBean();
bean15.setAreaId(753);
bean15.setAreaCode("26");
bean15.setAreaName("梅州");
bean15.setParntAreaId(1);
bean15.setAreaDesc("梅州");
bean15.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean15);
OmAreaBean bean16 = new OmAreaBean();
bean16.setAreaId(768);
bean16.setAreaCode("27");
bean16.setAreaName("潮州");
bean16.setParntAreaId(1);
bean16.setAreaDesc("潮州");
bean16.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean16);
OmAreaBean bean17 = new OmAreaBean();
bean17.setAreaId(660);
bean17.setAreaCode("28");
bean17.setAreaName("汕尾");
bean17.setParntAreaId(1);
bean17.setAreaDesc("汕尾");
bean17.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean17);
OmAreaBean bean18 = new OmAreaBean();
bean18.setAreaId(763);
bean18.setAreaCode("29");
bean18.setAreaName("清远");
bean18.setParntAreaId(1);
bean18.setAreaDesc("清远");
bean18.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean18);
OmAreaBean bean19 = new OmAreaBean();
bean19.setAreaId(762);
bean19.setAreaCode("30");
bean19.setAreaName("河源");
bean19.setParntAreaId(1);
bean19.setAreaDesc("河源");
bean19.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean19);
OmAreaBean bean20 = new OmAreaBean();
bean20.setAreaId(751);
bean20.setAreaCode("31");
bean20.setAreaName("韶关");
bean20.setParntAreaId(1);
bean20.setAreaDesc("韶关");
bean20.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean20);
OmAreaBean bean21 = new OmAreaBean();
bean21.setAreaId(662);
bean21.setAreaCode("32");
bean21.setAreaName("阳江");
bean21.setParntAreaId(1);
bean21.setAreaDesc("阳江");
bean21.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean21);
OmAreaBean bean22 = new OmAreaBean();
bean22.setAreaId(766);
bean22.setAreaCode("33");
bean22.setAreaName("云浮");
bean22.setParntAreaId(1);
bean22.setAreaDesc("云浮");
bean22.setCreateDate(new Date(System.currentTimeMillis()));
list.add(bean22);
mongoTemplate.insert(list, OmAreaBean.class);
OmAreaBean bean = mongoTemplate.findOne(query(where("areaId").is(1)),
OmAreaBean.class);
assertThat(bean.getAreaName(), is("广东省"));
}