@Test public void createKeywordShouldWorkCorrectlyWhenKeywordExists() { String value = "something"; Keyword keyword = new Keyword(value); service.createKeyword(value); service.createKeyword(value); service.createKeyword(value); assertNotNull(keywordDao.getByValue(keyword)); }
@Test(expected = IllegalArgumentException.class) public void createKeywordShouldThrowOnNullKeyword() { service.createKeyword(null); }