Skip to content

Instantly share code, notes, and snippets.

@michal-lipski
Created October 2, 2013 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michal-lipski/6794811 to your computer and use it in GitHub Desktop.
Save michal-lipski/6794811 to your computer and use it in GitHub Desktop.
@Test
public void document_from_my_company_are_visible_to_me() throws Exception {
Document document = new Document(DOC_ID).company(ORG_ID);
when(documentManagementService.findById(DOC_ID)).thenReturn(document);
when(userContext.getMyCompanyId()).thenReturn(ORG_ID);
boolean accessibleToMe = permissionService.isDocumentAccesibleToMe(DOC_ID);
assertThat(accessibleToMe).isTrue();
}
@Test
public void document_from_my_company_are_visible_to_me() throws Exception {
iAmUserFromCompany(ORANGE);
boolean accessibleToMe = isDocumentAccesibleToMe(documentFromCompany(ORANGE));
assertThat(accessibleToMe).isTrue();
}
@michal-lipski
Copy link
Author

extract documentFromCompany(ORANGE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment