Package org.javalite.activejdbc.test_models

Examples of org.javalite.activejdbc.test_models.Apple


public class UnmaganedIdTest extends ActiveJDBCTest {

    @Test
    public void shouldInsertNewRecord(){

        Apple apple = new Apple();
        apple.set("apple_type", "sweet");
        apple.setId(1);
        apple.insert();

        Apple apple1 = new Apple();
        apple1.set("apple_type", "sour");
        apple1.setId(2);
        apple1.insert();

        the(Apple.count()).shouldBeEqual(2);
        the(Apple.findById(1).get("apple_type")).shouldBeEqual("sweet");
        the(Apple.findById(2).get("apple_type")).shouldBeEqual("sour");
    }
View Full Code Here

TOP

Related Classes of org.javalite.activejdbc.test_models.Apple

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.