2017-10-27 23:45:27 +02:00
|
|
|
package com.baeldug.groovyconfig;
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
|
|
|
|
2018-09-29 21:12:21 +05:30
|
|
|
public class XmlConfigurationUnitTest {
|
2017-10-27 23:45:27 +02:00
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void whenXmlConfig_thenCorrectPerson() {
|
|
|
|
|
final ApplicationContext applicationContext = new ClassPathXmlApplicationContext("xml-bean-config.xml");
|
|
|
|
|
|
|
|
|
|
JavaPersonBean j = (JavaPersonBean) applicationContext.getBean("JavaPersonBean");
|
|
|
|
|
|
|
|
|
|
assertEquals("30", j.getAge());
|
|
|
|
|
assertEquals("brown", j.getEyesColor());
|
|
|
|
|
assertEquals("brown", j.getHairColor());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|