Revision e6d7b501
Added by Andreas Müller almost 7 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/validation/MustHaveAuthorityTest.java | ||
---|---|---|
22 | 22 |
|
23 | 23 |
import eu.etaxonomy.cdm.model.agent.Person; |
24 | 24 |
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer; |
25 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
25 |
import eu.etaxonomy.cdm.model.name.IBotanicalName;
|
|
26 | 26 |
import eu.etaxonomy.cdm.model.name.Rank; |
27 | 27 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
28 | 28 |
|
... | ... | |
41 | 41 |
@SuppressWarnings("unused") |
42 | 42 |
private static final Logger logger = Logger.getLogger(MustHaveAuthorityTest.class); |
43 | 43 |
|
44 |
private BotanicalName name; |
|
44 |
private IBotanicalName name;
|
|
45 | 45 |
|
46 | 46 |
@Before |
47 | 47 |
public void setUp() { |
... | ... | |
61 | 61 |
|
62 | 62 |
@Test |
63 | 63 |
public void testValidSpecificName() { |
64 |
Set<ConstraintViolation<BotanicalName>> constraintViolations = validator.validate(name, Level2.class); |
|
64 |
Set<ConstraintViolation<IBotanicalName>> constraintViolations = validator.validate(name, Level2.class);
|
|
65 | 65 |
assertTrue("There should be no constraint violations as this name has the correct epithets for it rank",constraintViolations.isEmpty()); |
66 | 66 |
} |
67 | 67 |
|
... | ... | |
69 | 69 |
public void testValidSpecificNameWithBasionymAuthorship() { |
70 | 70 |
name.setAuthorshipCache(null); |
71 | 71 |
name.setBasionymAuthorship(Person.NewInstance()); |
72 |
Set<ConstraintViolation<BotanicalName>> constraintViolations = validator.validate(name, Level2.class); |
|
72 |
Set<ConstraintViolation<IBotanicalName>> constraintViolations = validator.validate(name, Level2.class);
|
|
73 | 73 |
assertTrue("There should be no constraint violations as this name has the correct epithets for it rank",constraintViolations.isEmpty()); |
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
@Test |
77 | 77 |
public void testInValidSpecificName() { |
78 | 78 |
name.setAuthorshipCache(null); |
79 |
Set<ConstraintViolation<BotanicalName>> constraintViolations = validator.validate(name, Level2.class); |
|
79 |
Set<ConstraintViolation<IBotanicalName>> constraintViolations = validator.validate(name, Level2.class);
|
|
80 | 80 |
assertFalse("There should be a constraint violation as this name does not have a specific epithet",constraintViolations.isEmpty()); |
81 | 81 |
} |
82 | 82 |
|
... | ... | |
86 | 86 |
name.setAuthorshipCache(null); |
87 | 87 |
name.setBasionymAuthorship(null); |
88 | 88 |
name.setRank(Rank.SUBSPECIES()); |
89 |
Set<ConstraintViolation<BotanicalName>> constraintViolations = validator.validate(name, Level2.class); |
|
90 |
assertTrue("There should be no constraint violations as this name has the correct epithets for it rank",constraintViolations.isEmpty()); |
|
89 |
Set<ConstraintViolation<IBotanicalName>> constraintViolations = validator.validate(name, Level2.class);
|
|
90 |
assertTrue("There should be no constraint violations as this name has the correct epithets for it rank", constraintViolations.isEmpty());
|
|
91 | 91 |
} |
92 | 92 |
} |
Also available in: Unified diff
ref #6368 remove TaxonNameBase subclasses