Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

StubFactory

...

StubFactory is used to create temporary mocks for front-end and back-end developers before real models and real data is applied.
The feature of the class is ability to generate different instances of simple or complex types.

Overview

StubFactory takes a Class instance and returns an object which fields are filled with appropriate data.

StubFactory can generate:

  • primitives (boolean, short, int and so on)

  • string

  • list

  • map

  • complex object e.g. Person (name, age, birthday...)

StubFactory works recursively, so it can generate collections with other nested types e.g. List<Map<List<Integer>, String>> and so on.

Usage

The basic usage of StubFactory:

...