podam icon indicating copy to clipboard operation
podam copied to clipboard

ManufaturePOJO to String class on Java8

Open pfaisco opened this issue 10 years ago • 3 comments

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

pfaisco avatar Jul 14 '16 09:07 pfaisco

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

daivanov avatar Jul 16 '16 11:07 daivanov

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

daivanov avatar Aug 22 '16 15:08 daivanov

Fixed in 6.0.4-SNAPSHOT

daivanov avatar Aug 22 '16 19:08 daivanov