Package poc.configurable

Source Code of poc.configurable.ServiceInjectionTests

package poc.configurable;

import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

import org.junit.Test;
import org.springframework.context.support.GenericXmlApplicationContext;

public class ServiceInjectionTests {

  @Test
  public void testServiceInjection() {
    new GenericXmlApplicationContext("/application-context.xml");

    // Entity should now be enhanced
    Entity entity = new Entity();
    assertThat("service was not injected into @Configurable entity",
        entity.getService(), notNullValue());
  }

  /**
   * When uncommented, this method interferes with weaving such that Entity does not
   * get injected with its @Autowired Service.
   */
  //void someMethod(Entity entity) { }
}
TOP

Related Classes of poc.configurable.ServiceInjectionTests

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.