Package ngdemo.domain

Examples of ngdemo.domain.User


public class DummyMockRepositoryImpl extends GenericMockRepository<User> implements DummyRepository {

    @Override
    public User getDefaultUser() {
        User user = new User();
        user.setFirstName("JonFromREST");
        user.setLastName("DoeFromREST");
        return user;
    }
View Full Code Here


        return user;
    }

    @Override
    public User update(User user) {
        User byId = this.getById(user.getId());
        byId.setFirstName(user.getFirstName());
        byId.setLastName(user.getLastName());
        return byId;
    }
View Full Code Here

        return byId;
    }

    @Override
    public void remove(int id) {
        User byId = this.getById(id);
        this.users.remove(byId);
    }
View Full Code Here

    }

    private List<User> createUsers() {
        int numberOfUsers = 10;
        for (int i = 0; i < numberOfUsers; i++) {
            User user = new User();
            user.setId(i + 1);
            user.setFirstName("Foo" + (i + 1));
            user.setLastName("Bar" + (i + 1));
            this.users.add(user);
        }
        return this.users;
    }
View Full Code Here

        return this.userRepository.getById(id);
    }

    @Override
    public User createNewUser(User user) {
        User u = this.userRepository.create(user);
        return u;
    }
View Full Code Here

         */

        ClientResponse resp = webService.path("web").path("users")
                .type(MediaType.APPLICATION_JSON_TYPE)
                .accept(MediaType.APPLICATION_JSON)
                .post(ClientResponse.class, new User());

        System.out.println("Got stuff: " + resp);
        String actual = resp.getEntity(String.class);
        String expectedId = "\"id\":11";

View Full Code Here

    }

    @Test
    public void testUpdateUserShouldReturnUpdatedUser() throws IOException {

        User updateUser = new User();
        updateUser.setId(1);
        updateUser.setFirstName("XX");
        updateUser.setLastName("YY");

        ClientResponse resp = webService.path("web").path("users/1")
                .type(MediaType.APPLICATION_JSON_TYPE)
                .accept(MediaType.APPLICATION_JSON)
                .put(ClientResponse.class, updateUser);
View Full Code Here

TOP

Related Classes of ngdemo.domain.User

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.