Package org.javalite.activejdbc

Source Code of org.javalite.activejdbc.LongIdTest

package org.javalite.activejdbc;

import org.javalite.activejdbc.test.ActiveJDBCTest;
import org.javalite.activejdbc.test_models.Person;
import org.junit.Test;

/**
* @author Igor Polevoy
*/
public class LongIdTest extends ActiveJDBCTest {

    @Test(expected = NullPointerException.class)
    public void shouldThrowNPEIfIdIsNull(){
        Person p = new Person();
        p.getLongId();
    }

    @Test
    public void shouldReturnValidLongId(){
        deleteAndPopulateTable("people");
        Person p = Person.findById(1);
        a(p.getLongId()).shouldBeEqual(1);
    }
}
TOP

Related Classes of org.javalite.activejdbc.LongIdTest

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.