@Test(expected = NotFoundException.class) public void getContentNull() { Owner owner = mock(Owner.class); when(oc.lookupByKey(eq("owner"))).thenReturn(owner); when(cc.lookupById(any(Owner.class), anyString())).thenReturn(null); ocr.getContent("owner", "10"); }
@Test public void getContent() { Owner owner = mock(Owner.class); Content content = mock(Content.class); when(oc.lookupByKey(eq("owner"))).thenReturn(owner); when(cc.lookupById(eq(owner), eq("10"))).thenReturn(content); assertEquals(content, ocr.getContent("owner", "10")); }