Skip to content

Commit 5e4957a

Browse files
committed
Improved testGetTagsSearch() unit test (#417).
1 parent 52483ef commit 5e4957a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/org/gitlab4j/api/TestTagsApi.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.gitlab4j.api;
22

3-
import static org.hamcrest.CoreMatchers.nullValue;
43
import static org.junit.Assert.assertEquals;
54
import static org.junit.Assert.assertFalse;
65
import static org.junit.Assert.assertNotNull;
@@ -185,8 +184,12 @@ public void testGetTagsSearch() throws GitLabApiException {
185184
String tagName = tags.get(0).getName();
186185
tags = gitLabApi.getTagsApi().getTags(testProject, null, null, tagName);
187186
assertNotNull(tags);
188-
assertTrue(tags.size() > 0);
187+
assertTrue(tags.size() == 1);
189188
assertEquals(tagName, tags.get(0).getName());
189+
190+
tags = gitLabApi.getTagsApi().getTags(testProject, null, null, "NOT_FOUND_TAG_NAME");
191+
assertNotNull(tags);
192+
assertTrue(tags.isEmpty());
190193
}
191194

192195
@Test

0 commit comments

Comments
 (0)