Package org.dayatang.ioc.spring.factory

Source Code of org.dayatang.ioc.spring.factory.ProviderWithAnnotationTest

package org.dayatang.ioc.spring.factory;

import org.dayatang.domain.InstanceProvider;
import org.dayatang.ioc.test.AbstractInstanceProviderTest;
import org.dayatang.ioc.test.MyService1;
import org.dayatang.ioc.test.Service;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ProviderWithAnnotationTest extends AbstractInstanceProviderTest {
 
  private SpringInstanceProvider instance;

  @Override
  protected InstanceProvider createInstanceProvider() {
    return new SpringInstanceProvider(SpringConfiguration.class);
  }

    @Test
    public void testGetInstanceByFactoryBean() {
        Service service = provider.getInstance(MyService1.class);
        assertEquals("I am Service 1", service.sayHello());
    }

}
TOP

Related Classes of org.dayatang.ioc.spring.factory.ProviderWithAnnotationTest

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.