1
|
package unitest;
|
2
|
|
3
|
import eu.dnetlib.goldoa.domain.Publication;
|
4
|
import eu.dnetlib.goldoa.domain.PublicationType;
|
5
|
import eu.dnetlib.goldoa.service.PublicationManagerImpl;
|
6
|
import org.junit.Test;
|
7
|
import org.junit.runner.RunWith;
|
8
|
import org.springframework.beans.factory.annotation.Autowired;
|
9
|
import org.springframework.test.annotation.Rollback;
|
10
|
import org.springframework.test.context.ContextConfiguration;
|
11
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
12
|
|
13
|
import javax.transaction.Transactional;
|
14
|
|
15
|
import static org.junit.Assert.assertEquals;
|
16
|
|
17
|
/**
|
18
|
* Created by panagiotis on 23/1/2017.
|
19
|
*/
|
20
|
@RunWith( SpringJUnit4ClassRunner.class )
|
21
|
@ContextConfiguration(locations = "classpath:applicationContext-goldoa-service-test.xml")
|
22
|
public class PublicationTest {
|
23
|
|
24
|
@Autowired
|
25
|
PublicationManagerImpl pb;
|
26
|
|
27
|
|
28
|
@Test
|
29
|
@Transactional
|
30
|
@Rollback(true)
|
31
|
public void checkPublicationType() {
|
32
|
|
33
|
Publication p = new Publication();
|
34
|
p.setType(PublicationType.ARTICLE);
|
35
|
|
36
|
System.out.println(p.getType());
|
37
|
assertEquals(p.getType(), PublicationType.ARTICLE);
|
38
|
|
39
|
}
|
40
|
|
41
|
}
|