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 PeriodVersionTestSamples {

    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 PeriodVersion getPeriodVersionSample1() {
        return new PeriodVersion()
            .id(1L)
            .name("name1")
            .description("description1")
            .periodVersion(1)
            .creationUsername("creationUsername1")
            .version(1);
    }

    public static PeriodVersion getPeriodVersionSample2() {
        return new PeriodVersion()
            .id(2L)
            .name("name2")
            .description("description2")
            .periodVersion(2)
            .creationUsername("creationUsername2")
            .version(2);
    }

    public static PeriodVersion getPeriodVersionRandomSampleGenerator() {
        return new PeriodVersion()
            .id(longCount.incrementAndGet())
            .name(UUID.randomUUID().toString())
            .description(UUID.randomUUID().toString())
            .periodVersion(intCount.incrementAndGet())
            .creationUsername(UUID.randomUUID().toString())
            .version(intCount.incrementAndGet());
    }
}
