mtedone / podam

PODAM - POjo DAta Mocker
https://mtedone.github.io/podam
MIT License
323 stars 750 forks source link

ManufaturePOJO to String class on Java8 #213

Closed pfaisco closed 8 years ago

pfaisco commented 8 years ago

Hi, If you run this code with java8, the manufature will gather the String constructor(String(byte[] bytes, int offset, int length), so when generating radom int you will get outOfBounds.

import org.junit.Test;
import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;

public class PodamProof {
    @Test
    public void testStringJava8(){
        PodamFactory factory = new PodamFactoryImpl();
        String pojo = factory.manufacturePojo(String.class);
        System.out.print(pojo);
   }     
  }

Kind Regards

daivanov commented 8 years ago

There is already a test for this and it doesn't fail.

daivanov commented 8 years ago

I have to admit that this plain String instantiation is not working in 6.0.3.RELEASE

daivanov commented 8 years ago

Fixed in 6.0.4-SNAPSHOT