Skip to content

Commit

Permalink
Add Controlled Vocabulary model unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladay committed Jul 12, 2023
1 parent 97efa65 commit d979d87
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/test/java/org/tdl/vireo/model/ControlledVocabularyTest.java
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)
);
}

}

0 comments on commit d979d87

Please sign in to comment.