Skip to content

Latest commit

 

History

History
 
 

object-mother

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
layout title folder permalink pumlid categories tags
pattern
Object Mother
object-mother
/patterns/object-mother/
LOr13iCW30JlVKNx0E3UKxxYW9KGWK7sklb-wR6dtLbfj9k15DxRurKbDo_isfudCEsTaj8TZuhJTpVMF0GiY7dqL9lVjDHqqOT2OQk7X4a0grZgPAkaiL-S4Vh0kOYH_vVeskFyVMyiPUKN
Creational
Java
Difficulty-Beginner

Object Mother

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

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