title: Android Studio tests not working
body: <p>What should I do when Android Studio for no reason starts reporting "No tests were found" ? The tests worked yesterday. Now I get this random error instead. </p>
  
  <p>The repository is <a href="http://github.com/montao/adventure" rel="nofollow noreferrer">available online</a>. My actual test klass looks like:</p>
  
  <pre><code>package dev.game.adventure;
  
  import static junit.framework.Assert.assertEquals;
  import static org.hamcrest.MatcherAssert.assertThat;
  import static org.hamcrest.CoreMatchers.*;
  import static org.mockito.Mockito.*;
  
  import org.junit.Ignore;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.mockito.Mock;
  import org.mockito.runners.MockitoJUnitRunner;
  
  import android.content.Context;
  import android.content.res.Resources;
  import android.graphics.drawable.Drawable;
  import android.support.test.InstrumentationRegistry;
  import android.widget.TableLayout;
  import android.widget.TextView;
  
  
  @RunWith(MockitoJUnitRunner.class)
  public class AdventureTest {
  
      private static final String FAKE_STRING = "HELLO WORLD";
  
      @Mock
      Simulation engine;
  
      @Mock
      AdventureWorld mWorld;
  
      @Mock
      Adventure mworld;
  
      @Mock
      Context aContext;
  
      @Mock
      FullscreenActivity mActivity;
  
      @Mock
      Drawable mDrawable;
  
      @Mock
      Resources mResources;
  
      @Mock
      Place mPlace;
  
      @Mock
      AdventureGame ag;
  
  
  
      @Test
      @Ignore
      public void Tedye(){
          //when(mWorld.defaultPlace()).thenReturn(mPlace);
         // myObjectUnderTest.wakeMeAfter(new WalkingPerson(myObjectUnderTest, mWorld, "new", 2, mActivity), 10);
          //String result2 = myObjectUnderTest.getHelloWorldString();
          //assertThat(result2, is(FAKE_STRING));}  createPlace("Heaven", target, R.mipmap.dungeon2);
          //    Adventure a = new Adventure(textview, mactivity, ag);
  
      }
  
  
      @Test
      @Ignore
      public void testd() {
  //           Textview scrollable = ''''''''''''(R.id.textView1);
  
          when(mWorld.defaultPlace()).thenReturn(mPlace);
          Context mCont;
  
      }
  
  
  
  
      @Test
      public void adventureWorld() {
         // Simulation myObjecUnderTest = new Simulation();
          Adventure a = new Adventure(new TextView(aContext), mActivity, ag);
          Player p = a.getPlayer();
          p.say("foobar", mActivity);
          p.say("Hello my name is " + a.getPlayer().getMe().name, mActivity);
  
      }
  
      @Test
      public void adventureTest () {
              Simulation myObjectUnderTest = new Simulation();
              when(mWorld.defaultPlace()).thenReturn(mPlace);
              myObjectUnderTest.wakeMeAfter(new WalkingPerson(myObjectUnderTest, mWorld, "new", 2, mActivity), 10);
              String result2 = myObjectUnderTest.getHelloWorldString();
              assertThat(result2, is(FAKE_STRING));
          }
  
          @Test
          public void personTest () {
              Simulation myObjectUnderTest = new Simulation();
              when(mResources.getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mActivity.getResources()).thenReturn(mResources);
              when(mActivity.getResources().getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mWorld.defaultPlace()).thenReturn(mPlace);
              WalkingPerson myObjectUnderTest2 = new WalkingPerson(myObjectUnderTest, mWorld, "blaha", 2, mActivity);
              String result2 = myObjectUnderTest2.getHelloWorldString();
              myObjectUnderTest2.getThings();
              myObjectUnderTest2.getWorld();
              assertThat(result2, is(FAKE_STRING));
          }
  
          @Test
          public void trollTest () {
              Simulation myObjectUnderTest = new Simulation();
              AdventureWorld ag;
              when(mResources.getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mActivity.getResources()).thenReturn(mResources);
              when(mActivity.getResources().getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mWorld.defaultPlace()).thenReturn(mPlace);
              WalkingPerson myObjectUnderTest2 = new Troll(myObjectUnderTest, mWorld, "blaha", mActivity);
              String result2 = myObjectUnderTest2.getHelloWorldString();
              myObjectUnderTest2.getThings();
              AdventureWorld adv = (AdventureWorld) myObjectUnderTest2.getWorld();
              //assertThat(adv.defaultPlace().toString().equals(mWorld.defaultPlace().toString()));
             // assertThat(adv.defaultPlace(), is(FAKE_STRING));
              assertThat(myObjectUnderTest2.getName(), is("Loke"));
              assertThat(adv.messsage, is(FAKE_STRING));
          }
  
          @Test
          public void cokeTest () {
              when(mWorld.getPlace("Dungeon")).thenReturn(mPlace);
              mWorld.getPlace("Dungeon").addThing(new CocaCola("Ljummen cola"));
              Simulation myObjectUnderTest = new Simulation();
              when(mResources.getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mActivity.getResources()).thenReturn(mResources);
              when(mActivity.getResources().getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              when(mWorld.defaultPlace()).thenReturn(mPlace);
              WalkingPerson myObjectUnderTest2 = new Troll(myObjectUnderTest, mWorld, "blaha", mActivity);
              String result2 = myObjectUnderTest2.getHelloWorldString();
              myObjectUnderTest2.getThings();
              myObjectUnderTest2.getWorld();
              assertThat(result2, is(FAKE_STRING));
          }
  
          @Test
          public void testPlace () {
              Simulation myObjectUnderTest = new Simulation();
              when(mResources.getDrawable(R.mipmap.dungeon)).thenReturn(mDrawable);
              mWorld.createPlace("Heaven", mActivity, R.mipmap.dungeon2);
              mWorld.createPlace("Hell", mActivity, R.mipmap.dungeon2);
              mWorld.connect("Heaven", "Hell", "Down", "Up");
              mWorld.randomPlace();
  
          }
  
          @Test
          public void useAppContext () throws Exception {
              // Context of the app under test.
              Context appContext = InstrumentationRegistry.getTargetContext();
              assertEquals("dev.game.adventure", appContext.getPackageName());
          }
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Kku7e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kku7e.png" alt="enter image description here"></a></p>
  
  <p>The build log: <a href="https://travis-ci.org/montao/adventure" rel="nofollow noreferrer">https://travis-ci.org/montao/adventure</a></p>