Package by.fly.service

Source Code of by.fly.service.UserServiceTest

package by.fly.service;

import by.fly.model.User;
import by.fly.repository.AbstractBaseTest;
import by.fly.repository.UserRepository;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

public class UserServiceTest extends AbstractBaseTest {

    @Autowired
    UserRepository userRepository;

    @Autowired
    UserService userService;

    @Autowired
    OrganizationService organizationService;

    @Test
    public void testBarcode() {
        User user = new User("fly", null, null, organizationService.getRootOrganization());
        user.setBarcode(userService.generateBarcode());
        userRepository.save(user);
        assertThat(user.getBarcode(), notNullValue());
    }

}
TOP

Related Classes of by.fly.service.UserServiceTest

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.