Using PODAM is easy. You can either declare it as a Maven dependency or, used it with Spring or, if you need to customise its behaviour, fork PODAM from GitHub and build it yourself.

Declaring PODAM as a Maven dependency

If you are using Maven and want to use PODAM directly in your project, you can declare it as a Maven dependency (always ensure you are using the latest version):

  <!-- <scope>test</scope> -->

Using PODAM with Spring

You can also use PODAM with Spring:

  • Define the Data Provider Strategy as a bean if you don't want the default (Random data)
  • Define PodamFactory bean, initialised with the Data Provider Strategy
  • Use the PodamFactory bean in your code
# Define your Spring app context

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

        <!-- The definition of PODAM factory -->
        <bean id="podamFactory" class="" />

# Use Podam Factory in your code


import javax.annotation.Resource;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;


 * @author mtedone
@ContextConfiguration(locations = {"classpath:podam-test-appContext.xml"})
public class PodamFactoryInjectionIntegrationTest
                extends AbstractJUnit4SpringContextTests {

        /** The Podam Factory */
        private PodamFactory factory;

        public void init() {
                Assert.assertNotNull("The PODAM factory cannot be null!", factory);
                Assert.assertNotNull("The factory strategy cannot be null!",

        public void testSimplePojo() {

                SimplePojoToTestSetters pojo = factory
                Assert.assertNotNull("The pojo cannot be null!", pojo);


Please note that the data provider strategy cannot be changed upon instantiation. If you want to use a different data provider strategy, you'll need to create a new instance of PodamFactory. This has been decided to preserve thread-safety and immutability of PodamFactory.

Building PODAM from the source

The following pre-requisites must be satisfied in order to build PODAM:

  • Git must be installed on your machine and the git command must be available from the command line (only if you are forking code from GitHub)
  • Maven must be installed on your machine and the mvn command must be available from the command line
  • Java 6 or later version must be installed on your machine and the environment variable JAVA_HOME must be set to the JDK/JRE installation root folder.
  • Your computer should be capable of connecting to the Internet to download Maven dependencies and your Maven settings should list, as one of the download repositories, Maven Central.

Once the pre-requisites have been satisfied, do the following:

# To build PODAM jar and execute the tests
mvn clean install   

# To build this documentation and Javadocs
mvn clean site:site