title: Play 2.4.6, configuring build settings for bytecode enhancement in tests
body: <p>I'm using Play framework 2.4.6 with Ebean and Java.</p>
  
  <p>When I run my tests, I cannot set the value of any field. I think the bytecode enhancement (automatic getter/setter generation) doesn't work.</p>
  
  <p>My test (keep calm, the framework is supposed to put the getter/setter for "name"):</p>
  
  <pre><code>    @Test
      public void createAndUpdate() {
          running(fakeApplication(), new Runnable() {
              public void run() {
                  Usuario newUser = new Usuario("bob@gmail.com", "secret", "Spongebob Squarepants");
                  newUser.save();
  
                  Usuario alterUser = Usuario.find.where().eq("email", "bob@gmail.com").findUnique();
                  alterUser.name = "another name";
                  alterUser.update();
  
                  Usuario bob = Usuario.find.where().eq("email", "bob@gmail.com").findUnique();
  
                  assertNotNull(bob);
                  assertEquals("another name", bob.name);
              }
          });
      }
  </code></pre>
  
  <p>I tried using <code>save()</code> instead of <code>update()</code> with no desired results.</p>
  
  <p>The test fails; output:</p>
  
  <pre><code>[error] Test IntegrationTest.createAndUpdate failed: expected:&lt;[another name]&gt; but was:&lt;[Spongebob Squarepants]&gt;, took 0.228 sec
  </code></pre>
  
  <p>I've read that Play bytecode enhancement doesn't work for the code into the "test" directory. According to this post <a href="https://groups.google.com/d/msg/play-framework/fRHXLZi0J1c/CS8b8XBNS3UJ" rel="nofollow">https://groups.google.com/d/msg/play-framework/fRHXLZi0J1c/CS8b8XBNS3UJ</a>, I need to configure the <code>buid.scala</code> file like this <a href="https://gist.github.com/joelso/3496872" rel="nofollow">https://gist.github.com/joelso/3496872</a></p>
  
  <p>The post is for the version 2.0.x so it uses the <code>build.scala</code> file, but for 2.4.x the build settings are into <code>build.sbt</code> and I haven't achieved to load it without errors.</p>
  
  <p>The question is, How can I configure the build settings file to work as the above post states but using the new <code>build.sbt</code> style?</p>
  
  <p>I also tried to use the old <code>build.scala</code> only, but it gives me errors in every line.</p>
  
  <p>I'm aware that the easiest solution is to manually put the getters/setters, but I'd like to try using the Play style.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>EDIT</p>
  
  <p>According to the documentation, my class has public, non static, non final fields. It has got only one public static field for getting a <code>Finder</code> object and make queries. The field in my class is just like in the documentation <a href="https://www.playframework.com/documentation/2.4.x/JavaEbean#Using-Model-superclass" rel="nofollow">https://www.playframework.com/documentation/2.4.x/JavaEbean#Using-Model-superclass</a>
  I even tried using a method instead of that static field, but it didn't make any difference.</p>
  
  <p>This is the "Usuario" class. I tried changing the "find" static field for a method, but the result was the same.</p>
  
  <pre><code>@Entity
  public class Usuario extends Model {
  
      @Id
      public Long id;
  
      public String email;
      public String password;
      public String name;
      public boolean esAdmin;
  
      public Usuario(String email, String password, String name) {
          this.email = email;
          this.password = password;
          this.name = name;
          this.esAdmin = false;
      }
  
  
  
      public static Find&lt;Long, Usuario&gt; find = new Find&lt;Long, Usuario&gt;() {};
  }
  </code></pre>