class Encoding {

    @NonNull
    public String toBase64(@NonNull String value) {
        return toBase64(value.getBytes(SSCharset.CHARSET));
    }

}

class EncodingTest {

    private static final String TEST_VALUE;
    private static final String TEST_VALUE_BASE64;
    private Encoding encoding;

    @Test
    public void toBase64FromString_ShouldEncodeToBase64String() {

        PowerMockito.when(Base64.encodeToString(TEST_VALUE.getBytes(SSCharset.CHARSET), Base64.NO_WRAP))
                .thenReturn(TEST_VALUE_BASE64);

        Assert.assertEquals(TEST_VALUE_BASE64, encoding.toBase64(TEST_VALUE));
    }

}