Revision c9b75310
Added by Andreas Müller over 3 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/AgentServiceImplTest.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.cdm.api.service; |
11 | 10 |
|
12 | 11 |
import static org.junit.Assert.assertEquals; |
... | ... | |
45 | 44 |
*/ |
46 | 45 |
public class AgentServiceImplTest extends CdmTransactionalIntegrationTest{ |
47 | 46 |
|
48 |
/** |
|
49 |
* |
|
50 |
*/ |
|
51 | 47 |
private static final UUID UUID_EHRENBERG = UUID.fromString("6363ae88-ec57-4b23-8235-6c86fbe59446"); |
52 | 48 |
|
53 | 49 |
@SuppressWarnings("unused") |
... | ... | |
59 | 55 |
@SpringBeanByType |
60 | 56 |
private INameService nameSerivce; |
61 | 57 |
|
62 |
|
|
63 | 58 |
@Test |
64 | 59 |
@DataSets({ |
65 | 60 |
@DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class, value="/eu/etaxonomy/cdm/database/ClearDB_with_Terms_DataSet.xml"), |
66 | 61 |
@DataSet(value="/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml") |
67 | 62 |
}) |
68 | 63 |
public void testConvertPerson2Team(){ |
69 |
String fullAuthor = "Original author"; |
|
64 |
|
|
65 |
//create data |
|
66 |
String fullAuthor = "Original author"; |
|
70 | 67 |
String nomTitle = "Abrev. aut."; |
71 | 68 |
Person person = Person.NewTitledInstance(fullAuthor); |
72 | 69 |
person.setNomenclaturalTitle(nomTitle); |
... | ... | |
79 | 76 |
service.save(person); |
80 | 77 |
nameSerivce.save(name); |
81 | 78 |
|
79 |
|
|
82 | 80 |
Team team = null; |
83 | 81 |
UpdateResult result = null; |
84 | 82 |
try { |
... | ... | |
93 | 91 |
Assert.assertEquals("Annotations should be moved", 1, team.getAnnotations().size()); |
94 | 92 |
Assert.assertNotNull("Contact must be copied too", team.getContact()); |
95 | 93 |
Assert.assertEquals("Team must be combination author now", team, name.getCombinationAuthorship()); |
96 |
|
|
97 | 94 |
} |
98 | 95 |
|
99 | 96 |
private Contact getContact(){ |
Also available in: Unified diff
cleanup