protected Session openSession() throws RepositoryException {
        if (ObjectHelper.isEmpty(getJcrEndpoint().getWorkspaceName())) {
            return getJcrEndpoint().getRepository().login(getJcrEndpoint().getCredentials());
        } else {
            return getJcrEndpoint().getRepository().login(getJcrEndpoint().getCredentials(),
                    getJcrEndpoint().getWorkspaceName());
        }
    }
@Test
    public void testNodeTypeIsSpecified() throws Exception {
        Exchange exchange = createExchangeWithBody("Test");
        exchange.getIn().removeHeader("testClass"); //there is no definition of such property in nt:resource
        exchange.getIn().setHeader(JcrConstants.JCR_NODE_NAME, "typedNode");
        exchange.getIn().setHeader(JcrConstants.JCR_NODE_TYPE, "nt:folder");
        Exchange out = template.send("direct:a", exchange);
        assertNotNull(out);
        String uuid = out.getMessage().getBody(String.class);
        Session session = openSession();
        try {
            Node node = session.getNodeByIdentifier(uuid);
            assertNotNull(node);
            assertEquals("/home/test/typedNode", node.getPath());
            assertEquals("nt:folder", node.getPrimaryNodeType().getName());
        } finally {
            if (session != null && session.isLive()) {
                session.logout();
            }
        }
    }