package org.academiadecodigo.enuminatti.restuser;

import org.academiadecodigo.enuminatti.restuser.models.User;
import org.academiadecodigo.enuminatti.restuser.services.UserService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class Initializer implements InitializingBean {

    @Autowired
    private UserService userService;

    @Override
    public void afterPropertiesSet() throws Exception {
        userService.add(new User("ricardo", "abc"));
        userService.add(new User("jean-pierre", "abc"));
    }
}
