title: How to run a simple JUnit4 test in Android Studio 1.1?
body: <p>I have an Android project that shows "Hello World". It was created from the "Blank Activity" template from Android Studio.</p>
  
  <p>I then add/create a new java class in my application package (the same package that has my activity). I call it Shape and add a simple constructor</p>
  
  <pre><code>public class Shape {
      public Shape(int i){
          if (i==0){
              throw new IllegalArgumentException("Cant have 0");
          }
      }
  }
  </code></pre>
  
  <p>Great. Now I have a class that isn't touching Android at all, and I want to unit test it. What should I do next?</p>
  
  <p><strong>This is where my question stops. Below I'll go through what I tried.</strong></p>
  
  <h2>Please note that I really have never tested before in Android or Java. Excuse me for "rookie" mistakes.</h2>
  
  <ol>
  <li>While in the Shape.java I go to "Navigate" > "Test"</li>
  <li>Hit enter to select "Create new Test"</li>
  <li>Get this popup, and select JUNIT4.</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/UR6yg.png" alt="enter image description here"></p>
  
  <ol start="4">
  <li>I then hit the fix button to fix the library not being found</li>
  <li>I get this popup</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/DtrQa.png" alt="enter image description here"></p>
  
  <ol start="6">
  <li>I'm not really sure what to select, so I select the default/highlighted.</li>
  <li><p>I write my test</p>
  
  <pre><code>package com.eghdk.getjunit4towork;
  
  import org.junit.Test;
  
  import static org.junit.Assert.*;
  
  public class ShapeTest {
      @Test(expected = IllegalArgumentException.class)
      public void testShapeWithInvalidArg() {
          new Shape(0);
      }
  }
  </code></pre></li>
  <li><p>At this point, I'm not really sure how to run my tests, but try to do this:
  <img src="https://i.stack.imgur.com/N3mme.png" alt="enter image description here"></p></li>
  <li><p>I get these errors when running</p>
  
  <blockquote>
    <p>Error:(3, 17) Gradle: error: package org.junit does not exist<br>
    Error:(5, 24) Gradle: error: package org.junit does not exist<br>
    Error:(8, 6) Gradle: error: cannot find symbol class Test</p>
  </blockquote></li>
  </ol>