    @Test
    public void testUnpublishDocument() throws InvalidChainException, OperationException, Exception {

        OperationContext ctx = new OperationContext(session);
        ctx.setInput(fileToPublish);
        OperationChain chain = new OperationChain("testpublish");
        chain.add(FetchContextDocument.ID);
        chain.add(PublishDocument.ID).set("target",section.getId());
        DocumentModel publishedDoc = (DocumentModel)service.run(ctx, chain);

        Assert.assertEquals("Section", session.getDocument(publishedDoc.getParentRef()).getTitle());
        Assert.assertEquals(1, session.getChildren(section.getRef()).size());


        OperationChain unpublishChain = new OperationChain("testunpublish");
        unpublishChain.add(FetchContextDocument.ID);
        unpublishChain.add(UnpublishDocument.ID);
        service.run(ctx, unpublishChain);

        Assert.assertEquals(0, session.getChildren(section.getRef()).size());



    }