From 0330d3cfa37cac2a8f577be4f0b0414194b0cf62 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 10 Jul 2021 11:47:45 +0200 Subject: [PATCH] Add getMarkerPacket() test method --- .../src/test/java/org/pgpainless/util/TestUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java b/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java index e204866c..8c700120 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java @@ -15,12 +15,17 @@ */ package org.pgpainless.util; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.Iterator; import java.util.Random; +import org.bouncycastle.bcpg.BCPGInputStream; +import org.bouncycastle.bcpg.MarkerPacket; + public class TestUtils { public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; @@ -49,4 +54,11 @@ public class TestUtils { } return sb.toString(); } + + public static MarkerPacket getMarkerPacket() throws IOException { + BCPGInputStream pgpIn = new BCPGInputStream(new ByteArrayInputStream("PGP".getBytes(StandardCharsets.UTF_8))); + MarkerPacket markerPacket = new MarkerPacket(pgpIn); + pgpIn.close(); + return markerPacket; + } }