コード例 #1
0
  @Test
  public void executeQuieryTest() {
    Request request = new Request();
    request.setDepartureStation("ГРОДНО");
    request.setDestinationStation("МИНСК");
    request.setDepartureDate(new Timestamp(99999));
    request.setArrivalDate(new Timestamp(99999));
    List<TripList> resList = service.executeQuiery(request);

    assertFalse(resList.isEmpty());

    resList.forEach(
        new Consumer<TripList>() {
          @Override
          public void accept(TripList tl) {
            assertNotNull(tl.getId());
            System.out.println("Id рейса: " + tl.getId());
            assertNotNull(tl.getRouteId());
            System.out.println("Id маршрута: " + tl.getRouteId());
            assertNotNull(tl.getTrainId());
            System.out.println("Id поезда: " + tl.getTrainId());
            System.out.println("Дата отправления: " + tl.getDepartureDate());
            System.out.println("Продано билетов: " + tl.getTicketsSold());
            System.out.println("---------------------");
            cnt++;
          }
        });

    System.out.println("Рейсов в выдаче: " + cnt);
  }
コード例 #2
0
 @Test
 public void setQuieryTest() {
   Request request = new Request();
   request.setDepartureStation("Grodno");
   request.setDestinationStation("Kukuevo");
   request.setDepartureDate(new Timestamp(99999));
   request.setArrivalDate(new Timestamp(99999));
   service.find(request);
 }