Skip to content

A Java library that builds a valued object from any class. Usefull for unit tests : easily feed an object with values

Notifications You must be signed in to change notification settings

remcalmels/build-me-a-sheep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

build-me-a-sheep

Java library that builds a valued object from any class.

Useful for tests : it easily feeds an object with default values, enjoy :)

In the library, a valued object is called a "Sheep"

Usage

Just call build method on SheepFactory :

Example :

Foo foo = (Foo) sheepFactory.build(Foo.class).get();

Notes :

  • The build method returns an Optional
  • SheepFactory is a Spring component

Overload default values

Default values are defined with @Value annotation in TypeProperties.

To overload them, just add these entries in a Spring properties file (application.yml*, ...) :

sheep:
  types:
    boolean: true
    integer: 4
    long: 789

About

A Java library that builds a valued object from any class. Usefull for unit tests : easily feed an object with values

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages