title: gradle junit and error: cannot find symbol
body: <p>I'm attempting to run a simple junit test from gradle on an proof of concept class I've compiled and deployed to aws lambda. The class <code>Auth.java</code> takes a POJO with a single property <code>email</code>. It compiles fine on it's own and works on aws. However, when I run:</p>
  
  <pre><code>gradle build
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <pre><code>Auth.java:6: error: cannot find symbol
  System.out.println(payload.email);
  symbol:   variable email
  location: variable payload of type Object
  1 error
  :compileJava FAILED
  </code></pre>
  
  <p>If I <code>System.out.println(payload.email);</code> from within <code>TestAuth.java</code> I can access the object's property no problem. Am I failing to grasp some key java or gradle concept here? I've refactored this things 5 different ways and still, I always receive this cannot find symbol error. Anybody have any ideas? Here's my simplified code.</p>
  
  <hr>
  
  <p>./src/main/java/Auth.java</p>
  
  <pre><code>package works.valt.api;
  
  public class Auth {
  
      public Auth(Object payload) {
          System.out.println(payload.email);
      }
  
  }
  </code></pre>
  
  <p>./src/test/java/TestAuth.java</p>
  
  <pre><code>import org.junit.Test;
  import org.junit.Before;
  import static org.junit.Assert.assertEquals;
  import works.valt.api.Auth;
  
  public class TestAuth {
  
      public class Payload {
        public String email = "test@testing.com";
      }
  
      private Payload payload;
  
      // create payload
      @Before
      public void setUp() {
        this.payload = new Payload();
      }    
  
     @Test
     public void testResponse() {
        Auth response = new Auth(this.payload);
     }
  </code></pre>
  
  <p>}</p>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'java'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testCompile 'junit:junit:4.12'
  }
  
  test {
      testLogging.showStandardStreams = true
  }
  
  task buildZip(type: Zip) {
      from compileJava
      from processResources              
      into('lib') {
          from configurations.runtime
      }           
  }
  
  build.dependsOn buildZip
  </code></pre>