-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Controlled Vocabulary model unit tests.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/test/java/org/tdl/vireo/model/ControlledVocabularyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.tdl.vireo.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Stream; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.mockito.InjectMocks; | ||
|
||
public class ControlledVocabularyTest extends AbstractModelTest<ControlledVocabulary> { | ||
|
||
@InjectMocks | ||
private ControlledVocabulary controlledVocabulary; | ||
|
||
@Override | ||
protected ControlledVocabulary getInstance() { | ||
return controlledVocabulary; | ||
} | ||
|
||
protected static Stream<Arguments> provideGetterParameters() { | ||
return getParameterStream(); | ||
} | ||
|
||
protected static Stream<Arguments> provideSetterParameters() { | ||
return getParameterStream(); | ||
} | ||
|
||
private static Stream<Arguments> getParameterStream() { | ||
List<VocabularyWord> dictionary = new ArrayList<>(); | ||
VocabularyWord vocabularyWord = new VocabularyWord(); | ||
|
||
vocabularyWord.setId(1L); | ||
dictionary.add(vocabularyWord); | ||
|
||
return Stream.of( | ||
Arguments.of("name", "value"), | ||
//Arguments.of("dictionary", dictionary), // FIXME: This is failing on NPE. | ||
Arguments.of("isEntityProperty", true), | ||
Arguments.of("isEntityProperty", false) | ||
); | ||
} | ||
|
||
} |