@@ -0,0 +1,2172 @@
+package org.croudtrip;%0A%0A%0Aimport org.croudtrip.api.TripsResource;%0Aimport org.croudtrip.api.account.UserDescription;%0Aimport org.croudtrip.api.account.Vehicle;%0Aimport org.croudtrip.api.account.VehicleDescription;%0Aimport org.croudtrip.api.directions.RouteLocation;%0Aimport org.croudtrip.api.trips.TripOfferDescription;%0Aimport org.croudtrip.api.trips.TripQueryDescription;%0Aimport org.croudtrip.api.trips.TripQueryResult;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.util.UUID;%0A%0Apublic class SuperTripsTest %7B%0A%0A%09private ApiFactory apiFactory = new ApiFactory();%0A%0A%09@Test%0A%09public void testAddUser() %7B%0A%09%09// register user%0A%09%09UserDescription user = new UserDescription(UUID.randomUUID().toString() + %22@foobar.de%22, %22foo%22, %22bar%22, %22foobar%22);%0A%09%09apiFactory.getUsersResource().registerUserSynchronously(user);%0A%09%09apiFactory.setUser(user);%0A%0A%09%09// add vehicle%0A%09%09Vehicle vehicle = apiFactory.getVehicleResource().addVehicleSynchronously(new VehicleDescription(%22foo%22, %22bar%22, %22foobar%22, 4));%0A%0A%09%09// add offers%0A%09%09TripsResource tripsResource = apiFactory.getTripsResource();%0A%0A%09%09// Nuernberg -%3E Leipzig%0A%09%09tripsResource.addOfferSynchronously(new TripOfferDescription(%0A%09%09%09%09new RouteLocation(49.4360936, 11.1011232),%0A%09%09%09%09new RouteLocation(51.3417825 ,12.3936349),%0A%09%09%09%0925000,%0A%09%09%09%0942,%0A%09%09%09%09vehicle.getId()));%0A%0A%09%09// Hannover -%3E Dresden%0A%09%09tripsResource.addOfferSynchronously(new TripOfferDescription(%0A%09%09%09%09new RouteLocation(52.3796664, 9.7614715),%0A%09%09%09%09new RouteLocation(51.0768337, 13.7725857),%0A%09%09%09%0925000,%0A%09%09%09%0942,%0A%09%09%09%09vehicle.getId()));%0A%0A%09%09// Berlin -%3E Prag%0A%09%09tripsResource.addOfferSynchronously(new TripOfferDescription(%0A%09%09%09%09new RouteLocation(52.5075419, 13.4251364),%0A%09%09%09%09new RouteLocation(50.0596696, 14.4656239),%0A%09%09%09%0925000,%0A%09%09%09%0942,%0A%09%09%09%09vehicle.getId()));%0A%0A%09%09// query offers%0A%09%09TripQueryResult queryResult = tripsResource.queryOffersSynchronously(new TripQueryDescription(%0A%09%09%09%09new RouteLocation(49.4360936, 11.1011232),%0A%09%09%09%09new RouteLocation(50.0596696, 14.4656239),%0A%09%09%09%0960 * 60));%0A%0A%09%09Assert.assertNotNull(queryResult.getReservations());%0A%09%09Assert.assertFalse(queryResult.getReservations().isEmpty());%0A%09%09Assert.assertEquals(3, queryResult.getReservations().get(0).getReservations().size());%0A%09%7D%0A%0A%7D%0A

add SuperTripsTest