package nu.studer.gradle.util;

import org.junit.Test;

import java.io.UnsupportedEncodingException;

import static org.junit.Assert.assertArrayEquals;

public class Base64Test {

    @Test
    public void encodeDecode() throws UnsupportedEncodingException {
        byte[] textToEncode = "Some text that needs to be encoded.".getBytes("UTF-8");

        String encoded = Base64.encodeBase64(textToEncode);
        byte[] decoded = Base64.decodeBase64(encoded);

        assertArrayEquals(textToEncode, decoded);
    }

}

@@ -144,16 +144,61 @@
 yEquals;
+%0Aimport static org.junit.Assert.assertEquals;
 %0A%0Apublic
@@ -558,10 +558,228 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void printHexBinary() %7B%0A        byte%5B%5D bytes = new byte%5B%5D%7B-128, -1, 0, 9, 10, 11, 17, 127%7D;%0A        String hex = Base64.printHexBinary(bytes);%0A        assertEquals(%2280FF00090A0B117F%22, hex);%0A    %7D%0A%0A
 %7D%0A

Move coverage for printHexBinary