package com.atlassian.stash.internal.backup.liquibase;

import org.junit.Test;

import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class DefaultChangeSetIdGeneratorTest {
    @Test
    public void testIdsChange() {
        DefaultChangeSetIdGenerator generator = new DefaultChangeSetIdGenerator();
        String id1 = generator.next("test");
        String id2 = generator.next("test");
        assertThat(id1, not(equalTo(id2)));
    }

    @Test
    public void testPrefixing() {
        DefaultChangeSetIdGenerator generator = new DefaultChangeSetIdGenerator();
        assertTrue(generator.next("blah").startsWith("blah"));
    }
}
