public static ApplicationEntity createEDIEntity(
            String ediMessage, ContentType ediMessageContentType, String contentTransferEncoding, boolean isMainBody,
            String filename)
            throws CamelException {
        ObjectHelper.notNull(ediMessage, "EDI Message");
        ObjectHelper.notNull(ediMessageContentType, "EDI Message Content Type");
        String charset = null;
        if (ediMessageContentType.getCharset() != null) {
            charset = ediMessageContentType.getCharset().toString();
        }
        switch (ediMessageContentType.getMimeType().toLowerCase()) {
            case AS2MediaType.APPLICATION_EDIFACT:
                return new ApplicationEDIFACTEntity(ediMessage, charset, contentTransferEncoding, isMainBody, filename);
            case AS2MediaType.APPLICATION_EDI_X12:
                return new ApplicationEDIX12Entity(ediMessage, charset, contentTransferEncoding, isMainBody, filename);
            case AS2MediaType.APPLICATION_EDI_CONSENT:
                return new ApplicationEDIConsentEntity(ediMessage, charset, contentTransferEncoding, isMainBody, filename);
            case AS2MediaType.APPLICATION_XML:
                return new ApplicationXMLEntity(ediMessage, charset, contentTransferEncoding, isMainBody, filename);
            default:
                throw new CamelException("Invalid EDI entity mime type: " + ediMessageContentType.getMimeType());
        }

    }
@Test
    public void testCreateEDIEntityContentTypeWithoutContentDisposition() throws Exception {
        ContentType ediMessageContentType = ContentType.create(AS2MediaType.APPLICATION_EDIFACT, (String) null);
        String ediMessage = "whatever";
        ApplicationEntity applicationEntity
                = EntityUtils.createEDIEntity(ediMessage, ediMessageContentType, null, false, "");
        String actualContentType = applicationEntity.getContentType();
        Assertions.assertEquals("application/edifact", actualContentType, "content type matches");
        Header[] actualContentDisposition = applicationEntity.getHeaders(AS2Header.CONTENT_DISPOSITION);
        Assertions.assertEquals(0, actualContentDisposition.length, "no Content-Disposition headers found");
    }