@Test public void getProductByUuid() { String valid = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6"; String invalid = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb6"; User user = new User(); user.setUUID("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0"); user.setUsername("koko"); Product product = dao.getProductByUuid(valid); Assert.assertNotNull(product); Assert.assertEquals(product.getId().intValue(), 6); product = dao.getProductByUuid(invalid); Assert.assertNull(product); product = dao.getProductByUuid(valid); Assert.assertNotNull(product); Assert.assertEquals(product.getId().intValue(), 6); product = dao.getProductByUuid(null); Assert.assertNull(product); }