/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ee.tlu.htk.dippler.utils; import ee.tlu.htk.dippler.utils.GenerateId; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; // Using assertThat and importing Matchers for that import static org.hamcrest.CoreMatchers.*; import static org.junit.matchers.JUnitMatchers.*; /** * * @author pjotr */ public class GenerateIdTest { public GenerateIdTest() { } @BeforeClass public static void setUpClass() throws Exception { } @AfterClass public static void tearDownClass() throws Exception { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of generateUID method, of class GenerateId. */ @Test public void testGenerateUID() { System.out.println("generateUID"); String result = GenerateId.generateUID(); assertNotNull(result); } /** * Test of getUID method, of class GenerateId. */ @Test public void testGetUID_String() { System.out.println("getUID + prefix"); String prefix = "prefix"; String result = GenerateId.getUID(prefix); assertThat(result, allOf(containsString(prefix),notNullValue())); } /** * Test of getUID method, of class GenerateId. */ @Test public void testGetUID_0args() { System.out.println("getUID"); String result = GenerateId.getUID(); assertNotNull(result); } }