Package org.amplafi.hivemind.factory.mock.MockBuilderFactoryImpl

Examples of org.amplafi.hivemind.factory.mock.MockBuilderFactoryImpl.MockSwitcher


        ServiceImplementationFactory intercepted = (ServiceImplementationFactory) stack.peek();

        assertNotNull(intercepted);

        SomeService result = (SomeService) intercepted.createCoreServiceImplementation(factoryParameters);
        MockSwitcher switcher = (MockSwitcher) Proxy.getInvocationHandler(result);
        assertSame(switcher.getRealService(), realCreatedService);
        assertSame(switcher.getUnderlyingService(), realCreatedService);

        // now tell factory that we always want the mock.
        factory.getMockOverride().add(SomeService.class);
        assertSame(switcher.getRealService(), realCreatedService);
        assertNotSame(switcher.getUnderlyingService(), realCreatedService);
    }
View Full Code Here

TOP

Related Classes of org.amplafi.hivemind.factory.mock.MockBuilderFactoryImpl.MockSwitcher

Copyright © 2018 www.massapicom. 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.