Files
java-design-patterns/object-mother
Ilkka Seppälä 932836f68b Update license plugin (#2020)
* update license plugin

* suppress linelength and emptylineseparator rules

* fix checkstyle error

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
2022-09-14 23:22:24 +05:30
..
2019-12-07 18:03:49 +02:00
2022-09-14 23:22:24 +05:30
2022-09-14 23:22:24 +05:30

layout, title, folder, permalink, categories, language, tags
layout title folder permalink categories language tags
pattern Object Mother object-mother /patterns/object-mother/ Creational en
Instantiation

Object Mother

Define a factory of immutable content with separated builder and factory interfaces.

Class diagram

alt text

Applicability

Use the Object Mother pattern when

  • You want consistent objects over several tests
  • You want to reduce code for creation of objects in tests
  • Every test should run with fresh data

Credits