MaskImpl extends RelationalChildRestrictedObject implements Mask { @Override public Permission getParent(final UnitOfWork transaction) throws KException { ArgCheck.isNotNull(transaction, "transaction"); ArgCheck.isTrue((transaction.getState() == State.NOT_STARTED), "transaction state must be NOT_STARTED"); final KomodoObject grouping = super.getParent(transaction); final Permission result = Permission.RESOLVER.resolve(transaction, grouping.getParent(transaction)); return result; } MaskImpl( final UnitOfWork uow,
                     final Repository repository,
                     final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String getOrder( final UnitOfWork uow ); @Override Permission getParent(final UnitOfWork transaction); @Override int getTypeId(); @Override void setOrder( final UnitOfWork uow,
                          final String newOrder );  }
@Test public void shouldFailConstructionIfNotMask() { if ( RelationalObjectImpl.VALIDATE_INITIAL_STATE ) { try { new MaskImpl( getTransaction(), _repo, this.mask.getParent( getTransaction() ).getAbsolutePath() ); fail(); } catch ( final KException e ) { } } }
@Test public void shouldHaveParentPermission() throws Exception { assertThat( this.mask.getParent( getTransaction() ), is( instanceOf( Permission.class ) ) ); }