item1.setCode("blah1");
item1.setNumberOfRegions((long)123);
item1.setRenderSequence((long)432);
item1.setUserSelectable(true);
MongoDbPageLayout toSave = new MongoDbPageLayout();
expect(template.findOne(new Query(where("code").is(item1.getCode())), pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn(toSave);
template.save(isA(MongoDbPageLayout.class), eq(CollectionNames.PAGE_LAYOUT_COLLECTION));
expectLastCall();
replay(template);
PageLayout saved = pageLayoutRepository.save(item1);