package com.oguerreiro.resilient.domain;

import java.util.Random;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

public class InputDataTestSamples {

    private static final Random random = new Random();
    private static final AtomicLong longCount = new AtomicLong(random.nextInt() + (2 * Integer.MAX_VALUE));
    private static final AtomicInteger intCount = new AtomicInteger(random.nextInt() + (2 * Short.MAX_VALUE));

    public static InputData getInputDataSample1() {
        return new InputData()
            .id(1L)
            .changeUsername("changeUsername1")
            .dataSource("dataSource1")
            .dataUser("dataUser1")
            .dataComments("dataComments1")
            .creationUsername("creationUsername1")
            .version(1);
    }

    public static InputData getInputDataSample2() {
        return new InputData()
            .id(2L)
            .changeUsername("changeUsername2")
            .dataSource("dataSource2")
            .dataUser("dataUser2")
            .dataComments("dataComments2")
            .creationUsername("creationUsername2")
            .version(2);
    }

    public static InputData getInputDataRandomSampleGenerator() {
        return new InputData()
            .id(longCount.incrementAndGet())
            .changeUsername(UUID.randomUUID().toString())
            .dataSource(UUID.randomUUID().toString())
            .dataUser(UUID.randomUUID().toString())
            .dataComments(UUID.randomUUID().toString())
            .creationUsername(UUID.randomUUID().toString())
            .version(intCount.incrementAndGet());
    }
}
