Package org.superbiz.deltaspike.repository

Examples of org.superbiz.deltaspike.repository.UserRepository


    {
        final String userName = "gp";
        final String firstName = "Gerhard";
        final String lastName = "Petracek";

        UserRepository mockedUserRepository = mock(JpaUserRepository.class); //don't use the interface here to avoid issues with mockito and cdi proxies
        when(mockedUserRepository.loadUser(userName)).thenReturn(new User(userName, firstName, lastName.toUpperCase() /*just to illustrate that the mock-instance is used*/));
        mockManager.addMock(mockedUserRepository);


        this.windowContext.activateWindow("testWindow");

View Full Code Here


        final String firstName = "Gerhard";
        final String lastName = "Petracek";

        // mockito doesn't support interfaces...seriously? but you can mock CDI impl
        // here we don't have one so implementing for the test the interface
        UserRepository mockedUserRepository = (UserRepository) Proxy.newProxyInstance(
                Thread.currentThread().getContextClassLoader(),
                new Class<?>[]{ UserRepository.class},
                new InvocationHandler() {
                    @Override
                    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
View Full Code Here

TOP

Related Classes of org.superbiz.deltaspike.repository.UserRepository

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.