From a9b438ce548bd912b607cc85a0992b069fab4001 Mon Sep 17 00:00:00 2001 From: averyrak Date: Thu, 19 Dec 2024 01:17:14 -0500 Subject: [PATCH] handle mp4 like any other media in Embed toMap() --- .../src/main/java/com/intuit/karate/core/Embed.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/karate-core/src/main/java/com/intuit/karate/core/Embed.java b/karate-core/src/main/java/com/intuit/karate/core/Embed.java index 1a64510c9..b2625ecf3 100644 --- a/karate-core/src/main/java/com/intuit/karate/core/Embed.java +++ b/karate-core/src/main/java/com/intuit/karate/core/Embed.java @@ -108,15 +108,8 @@ public String getAsHtmlTag() { public Map toMap() { Map map = new HashMap(2); - if (resourceType == ResourceType.MP4) { - byte[] bytes = FileUtils.toBytes(getAsHtmlTag()); - String base64 = Base64.getEncoder().encodeToString(bytes); - map.put("data", base64); - map.put("mime_type", ResourceType.HTML.contentType); - } else { - map.put("data", getBase64()); - map.put("mime_type", resourceType.contentType); - } + map.put("data", getBase64()); + map.put("mime_type", resourceType.contentType); return map; }