    @Test
    public void testQRCode() throws Exception {

        GoogleAuthenticator authenticator = new GoogleAuthenticator();
        GoogleAuthenticatorKey key = authenticator.createCredentials();
        String encodedQrCode = MfaRegisterQRGenerator.getQRCode("testIssuer", "accountName", key.getKey());
        String result = decodeQrPng(encodedQrCode);

        String[] split = result.split("\\?");
        assertEquals("otpauth://totp/testIssuer:accountName", split[0]);
        List<String> list = Arrays.asList(split[1].split("&"));
        assertTrue(list.contains("issuer=testIssuer"));
        assertTrue(list.contains("secret=" + key.getKey()));
        assertEquals(2, list.size());
    }