liveBook · Manning

Mobile application

As explained in Contract Testing in Action

Software designed to run on mobile devices and provide functionality through a mobile user interface.

A mobile application is bundled software that runs on a mobile device, presents a mobile user interface, and communicates with external APIs. Because users update bundled releases at different times, reliable API contracts help preserve a seamless experience. section 5.0

When API expectations drift

A movie-search mobile app requests /movies. The app changes its expected release field from a raw date to a year, while the API still returns a date. The mismatch appears only after deployment unless a consumer contract provides earlier feedback. section 5.0

A practical mobile application integration separates responsibilities:

  • The data layer calls the external service through a MovieAPI interface and repository. section 5.1.2
  • Retrofit maps the /movies response into MoviesDTO and Movie objects before passing data to the presentation layer. section 5.1.2
  • An injectable client accepts its base URL, allowing tests to redirect requests to a Pact mock server. section 5.1.2
  • Separate mobile and provider contracts let an API evolve for one consumer without silently breaking another. section 1.2
Figure 5.1 Mobile expected response with Year field and movies API actual response with Date field
figure

Compare the mobile client's expected year field with the movies API's actual date field to see how an integration contract can drift. section 5.0

How Contract Testing in Action covers it

How deep it goes
Traces an Android data layer, Retrofit client, response models, test URL injection, and Pact integration, but not broader mobile development.
Examples
Demonstrates a movie-search app, a /movies endpoint, Movie models, Retrofit requests, and mismatched year and date responses.
What it assumes
Assumes foundational contract-testing knowledge and Android familiarity, while supplying implementation context for dependencies, annotations, and data-layer integration.
What you can do after
Apply it via Kotlin, Gradle, JUnit 5, Retrofit, and Pact to model API interactions and verify mobile-provider compatibility.
How it connects
Connects mobile applications with external APIs, data layers, consumer-driven contract testing, provider verification, and Pact Brokers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Contract Testing in Action. The section links point to the parts of the book it draws on.