@Test
    public void testGenerateSHA1() {

        // 160-bit key consisting of the bytes "12345678901234567890" repeated
        // as necessary
        final byte[] key = {
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
        };

        try {
            final TOTPGenerator totp = new TOTPGenerator(key, TOTPGenerator.Mode.SHA1, 8);
            assertEquals("94287082", totp.generate(59));
            assertEquals("07081804", totp.generate(1111111109));
            assertEquals("14050471", totp.generate(1111111111));
            assertEquals("89005924", totp.generate(1234567890));
            assertEquals("69279037", totp.generate(2000000000));
            assertEquals("65353130", totp.generate(20000000000L));
        }
        catch (InvalidKeyException e) {
            fail("SHA1 test key is invalid.");
        }


    }
Verifies the results of generating authentication codes using the TOTP
algorithm in SHA1 mode.
extensions/guacamole-auth-totp/src/test/java/org/apache/guacamole/totp/TOTPGeneratorTest.java