package com.warrenstrange.googleauth;


import org.junit.Test;

/*
 * Not really a unit test- but it shows usage
 */
public class GoogleAuthTest {

    @Test
    public void genSecretTest() {
        GoogleAuthenticator gauth = new GoogleAuthenticator();

        final GoogleAuthenticatorKey key = gauth.generateSecretKey();
        final String secret = key.getKey();

        String url = GoogleAuthenticatorKey.getQRBarcodeURL("testuser", "testhost", secret);

        System.out.println("Please register " + url);
        System.out.println("Secret key is " + secret);
    }


    // Change this to the saved secret from the running the above test.
    static String savedSecret = "VV5OVNP4S42DQSS3";

    @Test
    public void authTest() {
        // enter the code shown on device. Edit this and run it fast before the code expires!
        int code = 863311;

        GoogleAuthenticator ga = new GoogleAuthenticator();
        ga.setWindowSize(5);  //should give 5 * 30 seconds of grace...

        boolean r = ga.authorize(savedSecret, code);

        System.out.println("Check code = " + r);
    }


}

@@ -59,16 +59,17 @@
 est;%0A%0A/*
+*
 %0A * Not 
@@ -90,9 +90,9 @@
 test
--
+,
  but
@@ -105,47 +105,926 @@
 ows 
-usage%0A */%0Apublic class GoogleAuthTest %7B
+the basic usage of this package.%0A * To properly test the authenticator, manual intervention and multiple steps%0A * are required:%0A * %3Col%3E%0A * %3Cli%3ERun the test in order to generate the required information for a%0A * Google Authenticator application to be configured.%3C/li%3E%0A * %3Cli%3ESet the %3Ccode%3EsavedSecret%3C/code%3E field with the value generated by the%0A * %3Ccode%3EGoogleAuthTest#genSecretTest%3C/code%3E method.%3C/li%3E%0A * %3Cli%3EGenerate the current code with the Google Authenticator application and%0A * set the %3Ccode%3EcurrentCode%3C/code%3E accordingly.%3C/li%3E%0A * %3Cli%3ECheck that the %3Ccode%3E#authTest%3C/code%3E method correctly validates the%0A * data when invoking the %3Ccode%3EGoogleAuthenticator#authorize%3C/code%3E method.%0A * %3C/li%3E%0A * %3C/ol%3E%0A */%0Apublic class GoogleAuthTest %7B%0A%0A    // Change this to the saved secret from the running the above test.%0A    private static String savedSecret = %22VV5OVNP4S42DQSS3%22;%0A    private static int currentCode = 863311;
 %0A%0A  
@@ -1094,20 +1094,34 @@
 icator g
-auth
+oogleAuthenticator
  = new G
@@ -1189,14 +1189,44 @@
 ey =
- gauth
+%0A                googleAuthenticator
 .gen
@@ -1348,16 +1348,33 @@
 codeURL(
+%0A                
 %22testuse
@@ -1519,294 +1519,46 @@
  %7D%0A%0A
-%0A    // Change this to the saved secret from the running the above test.%0A    static String savedSecret = %22VV5OVNP4S42DQSS3%22;%0A%0A    @Test%0A    public void authTest() %7B%0A        // enter the code shown on device. Edit this and run it fast before the code expires!%0A        int code = 863311;%0A
+    @Test%0A    public void authTest() %7B
 %0A   
@@ -1733,16 +1733,23 @@
 ecret, c
+urrentC
 ode);%0A%0A 
@@ -1782,16 +1782,23 @@
 %22Check c
+urrentC
 ode = %22 

Update the test class and properly document it.