package com.armundia.app.login;

import javax.inject.Inject;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;

import com.armundia.armtest.ArmUnitTest;
import com.armundia.armtest.scenario.Scenario;
import com.armundia.core.users.entity.SeUsers;
import com.armundia.v2.shared.exception.ArmundiaException;


@Scenario(name="stub-db")
class LoginTest extends ArmUnitTest {
    @Inject
    private LoginManager loginManager;

    @Test
    void loginTest() throws ArmundiaException {
        String userid = "ZUXT2151";
        String password = "ArmuDemo#3";
        String clientVersion = "0.0.1";
            
        SeUsers utente = loginManager.login(userid, password, null, null, clientVersion);
        assertNotNull(utente, "utente should not be null after the login call");
        assertEquals(utente.getUserId(), "ZUXT2151", "utente should be ZUXT2151");
    }
}


