Skip to Main Content
Learn Spring for Android Application Development
book

Learn Spring for Android Application Development

by S. M. Mohi Us Sunnat, Igor Kucherenko
January 2019
Intermediate to advanced content levelIntermediate to advanced
392 pages
10h 11m
English
Packt Publishing
Content preview from Learn Spring for Android Application Development

Creating testing files

Let's write some test cases. To write this code, we need to create new files in the androidTest package. To do this, follow the steps:

  1. Now go to srcandroidTest | java | module_name of the project. Here is a screenshot of this directory:

  1. Create a class named MainActivityTest.kt with @RunWith(AndroidJUnit4::class) annotation. This annotation will link the test and the app features.

Let's create our very first Espresso test:

First of all, we need to connect our MainActivity class. To do this, we will initialize a variable of ActivityTestRule<MainActivity> and it will provide all the functionalities for the MainActivity ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Applications with Spring 5 and Vue.js 2

Building Applications with Spring 5 and Vue.js 2

James J. Ye

Publisher Resources

ISBN: 9781789349252Supplemental Content