Skip to content

This code takes a java bean and tries to serialize it as java code that sets recursively all the fields. This is useful if you want to mock an object and already get the object somewhere but you want to put it in the code.

License

Notifications You must be signed in to change notification settings

ManuelB/java-bean-to-code-serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-bean-to-code-serializer

This code takes a java bean and tries to serialize it as java code that sets recursively all the fields. This is useful if you want to mock an object and already get the object somewhere but you want to put it in the code.

This should be used together with mockito and https://github.com/ManuelB/mockito-caching-spy

To see a code example:

To use it add the following maven dependency:

  <dependency>
    <groupId>de.incentergy.test</groupId>
    <artifactId>java-bean-to-code-serializer</artifactId>
    <version>0.10</version>
  </dependency>

About

This code takes a java bean and tries to serialize it as java code that sets recursively all the fields. This is useful if you want to mock an object and already get the object somewhere but you want to put it in the code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages