@Test
  public void testJPopulatorFactoryBeanWithDefaultRandomizers() {

    Populator populator = getPopulatorFromSpringContext("/application-context.xml");

    // the populator managed by spring should be correctly configured
    assertThat(populator).isNotNull();

    // the populator should populate valid instances
    Person person = populator.populateBean(Person.class);

    assertPerson(person);
  }
  @Test
  public void testJPopulatorFactoryBeanWithCustomRandomizers() {

    Populator populator =
        getPopulatorFromSpringContext("/application-context-with-custom-randomizers.xml");

    // the populator managed by spring should be correctly configured
    assertThat(populator).isNotNull();

    // the populator should populate valid instances
    Person person = populator.populateBean(Person.class);

    assertPerson(person);

    assertThat(person.getEmail()).isNotNull().isNotEmpty().matches(".*@.*\\..*");
  }