use of models.Car in project play-cookbook by spinscale.
the class CsvTest method checkThatFindingAllWorks.
@Test
public void checkThatFindingAllWorks() {
new Car("VW", "Passat").save();
new Car("VW", "Golf").save();
Map<String, String> emptyMap = Collections.emptyMap();
CsvQuery query = new CsvQuery(Car.class, emptyMap);
List<Car> cars = query.fetch();
assertEquals(3, cars.size());
assertValidCar(cars.get(0), "BMW", "320");
assertValidCar(cars.get(1), "VW", "Passat");
assertValidCar(cars.get(2), "VW", "Golf");
}
use of models.Car in project play-cookbook by spinscale.
the class CsvTest method checkThatFinderWorks.
@Test
public void checkThatFinderWorks() {
Car car = Car.find("byBrand", "BMW").first();
assertValidCar(car, "BMW", "320");
List<Car> cars = Car.find("byBrandAndType", "BMW", "320").fetch();
assertValidCar(cars.get(0), "BMW", "320");
car = Car.find("byTypeAndBrand", "320", "BMW").first();
assertValidCar(car, "BMW", "320");
}
use of models.Car in project play-cookbook by spinscale.
the class CsvTest method readSimpleEntityById.
@Test
public void readSimpleEntityById() {
Car car = Car.findById(1L);
assertValidCar(car, "BMW", "320");
}
Aggregations