pageLayoutRepository.get(id);
}
@Test
public void save_Valid() {
PageLayout item1 = new MongoDbPageLayout();
item1.setCode("blah1");
expect(template.findOne(new Query(where("code").is(item1.getCode())), pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn(null);
template.save(isA(MongoDbPageLayout.class), eq(CollectionNames.PAGE_LAYOUT_COLLECTION));
expectLastCall();
replay(template);
PageLayout saved = pageLayoutRepository.save(item1);
assertThat(saved, is(instanceOf(MongoDbPageLayout.class)));
assertThat(saved.getCode(), is(sameInstance(item1.getCode())));
assertThat(saved.getNumberOfRegions(), is(sameInstance(item1.getNumberOfRegions())));
assertThat(saved.getRenderSequence(), is(sameInstance(item1.getRenderSequence())));
assertThat(saved.isUserSelectable(), is(sameInstance(item1.isUserSelectable())));
}