Revision 01f597fe
Added by Andreas Müller over 3 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/AgentServiceImplTest.java | ||
---|---|---|
113 | 113 |
|
114 | 114 |
service.save(person2); |
115 | 115 |
try{ |
116 |
UpdateResult result = service.convertPerson2Team(person2); |
|
116 |
UpdateResult result = service.convertPerson2Team(person2.getUuid());
|
|
117 | 117 |
team = (Team) result.getCdmEntity(); |
118 | 118 |
} catch (MergeException e) { |
119 | 119 |
Assert.fail("No Merge exception should be thrown, but was: " + e.getMessage()); |
... | ... | |
121 | 121 |
Assert.assertEquals("If person was completely empty we don't expect the title cache to be taken from person.nomenclaturalTitle", TeamDefaultCacheStrategy.EMPTY_TEAM, team.getTitleCache()); |
122 | 122 |
Assert.assertFalse("If person was completely empty we don't expect the title cache to be protected", team.isProtectedTitleCache()); |
123 | 123 |
Assert.assertEquals("Nom. title must be equal", person2.getNomenclaturalTitle(), team.getNomenclaturalTitle()); |
124 |
|
|
125 |
try{ |
|
126 |
service.convertPerson2Team(person2.getUuid()); |
|
127 |
Assert.fail("Non-existing person should throw an exception"); |
|
128 |
} catch (MergeException e) { |
|
129 |
Assert.fail("No Merge exception should be thrown, but was: " + e.getMessage()); |
|
130 |
}catch (IllegalArgumentException e) { |
|
131 |
//nothing to do |
|
132 |
} |
|
124 | 133 |
} |
125 | 134 |
|
126 | 135 |
private Contact getContact(){ |
Also available in: Unified diff
ref #4770, ref #4908 add test for person is null in person2Team converter