@Test public void isGroup() throws ComponentLookupException { Owner o = new DefaultOwner(OWNER, this.helper); Mockito.when(this.helper.getType(OWNER)).thenReturn("unknown", "user", "group", null); Assert.assertFalse(o.isGroup()); Assert.assertFalse(o.isGroup()); Assert.assertTrue(o.isGroup()); Assert.assertFalse(o.isGroup()); }
@Override public boolean isGroup() { return "group".equals(getType()); }
DefaultOwner implements Owner { @Override public boolean isGroup() { return "group".equals(getType()); } }
DefaultOwner implements Owner { @Override public boolean isGroup() { return "group".equals(getType()); } DefaultOwner(EntityReference user, EntityAccessHelper helper); }
DefaultOwner implements Owner { @Override public boolean isGroup() { return "group".equals(getType()); } DefaultOwner(EntityReference user, EntityAccessHelper helper); @Override String getType(); @Override boolean isUser(); @Override boolean isGroup(); @Override EntityReference getUser(); @Override String getUsername(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
DefaultOwner implements Owner { @Override public boolean isGroup() { return "group".equals(getType()); } DefaultOwner(EntityReference user, EntityAccessHelper helper); @Override String getType(); @Override boolean isUser(); @Override boolean isGroup(); @Override EntityReference getUser(); @Override String getUsername(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }