1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.email.service;
16
17 import org.apache.log4j.Logger;
18 import org.junit.AfterClass;
19 import org.junit.BeforeClass;
20 import org.junit.Test;
21 import org.springframework.context.ApplicationContext;
22 import org.springframework.context.support.FileSystemXmlApplicationContext;
23
24 import static org.junit.Assert.assertTrue;
25
26
27
28
29 public class EmailServiceImplTest {
30 private static final Logger LOG = Logger.getLogger(EmailServiceImpl.class);
31
32 private static ApplicationContext applicationContext;
33
34 private static String[] getConfigLocations() {
35 return new String[] { "classpath:/EmailSpringBeans.xml" };
36 }
37
38 @BeforeClass
39 public static void setUpClass() throws Exception {
40 EmailServiceImplTest.setApplicationContext(new FileSystemXmlApplicationContext(getConfigLocations()));
41 }
42
43 @AfterClass
44 public static void tearDownClass() throws Exception {
45 }
46
47 @Test
48 public void testSendEmail() {
49 EmailService service = (EmailService)getApplicationContext().getBean("emailService");
50 boolean response = service.sendEmail(null, null, null, null);
51 assertTrue( "Email not yet implemented.", !response);
52 }
53
54 public static ApplicationContext getApplicationContext() {
55 return applicationContext;
56 }
57
58 public static void setApplicationContext(ApplicationContext applicationContext) {
59 EmailServiceImplTest.applicationContext = applicationContext;
60 }
61 }