// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getDeviceId(){
//   String deviceId = BuildConfig.DEVICE_ID;
//   return deviceId.equals("DEFAULT_DEVICE_ID") ? null : deviceId;
// }
// 
// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getSecondVehicleId(){
//   String secondVehicleId = BuildConfig.SECOND_VEHICLE_ID;
//   return secondVehicleId.equals("DEFAULT_SECOND_VEHICLE_ID") ? null : secondVehicleId;
// }
// 
// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getVehicleId(){
//   String vehicleId = BuildConfig.VEHICLE_ID;
//   return vehicleId.equals("DEFAULT_VEHICLE_ID") ? null : vehicleId;
// }


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import rx.Subscriber;
import static junit.framework.Assert.assertTrue;
import static li.vin.net.TestHelper.getDeviceId;
import static li.vin.net.TestHelper.getSecondVehicleId;
import static li.vin.net.TestHelper.getVehicleId;
          @Override public void onNext(TimeSeries<Message> messageTimeSeries) {
            for (Message message : messageTimeSeries.getItems()) {
              assertTrue(message.id() != null && message.id().length() > 0);
              assertTrue(message.timestamp != null && message.timestamp.length() > 0);
            }

            if (messageTimeSeries.hasPrior()) {
              messageTimeSeries.loadPrior().toBlocking()
                  .subscribe(new Subscriber<TimeSeries<Message>>() {
                @Override public void onCompleted() {

                }

                @Override public void onError(Throwable e) {
                  e.printStackTrace();
                  assertTrue(false);
                }

                @Override public void onNext(TimeSeries<Message> messageTimeSeries) {
                  for (Message message : messageTimeSeries.getItems()) {
                    assertTrue(message.id() != null && message.id().length() > 0);
                    assertTrue(message.timestamp != null && message.timestamp.length() > 0);
                  }
                }
              });
            }
          }
        });
  }
  @Test public void getPagedMessagesByVehicleId() {
// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getDeviceId(){
//   String deviceId = BuildConfig.DEVICE_ID;
//   return deviceId.equals("DEFAULT_DEVICE_ID") ? null : deviceId;
// }
// 
// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getSecondVehicleId(){
//   String secondVehicleId = BuildConfig.SECOND_VEHICLE_ID;
//   return secondVehicleId.equals("DEFAULT_SECOND_VEHICLE_ID") ? null : secondVehicleId;
// }
// 
// Path: android-net/src/test/java/li/vin/net/TestHelper.java
// public static String getVehicleId(){
//   String vehicleId = BuildConfig.VEHICLE_ID;
//   return vehicleId.equals("DEFAULT_VEHICLE_ID") ? null : vehicleId;
// }


// Path: android-net/src/test/java/li/vin/net/MessagesIntegrationTests.java
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import rx.Subscriber;
import static junit.framework.Assert.assertTrue;
import static li.vin.net.TestHelper.getDeviceId;
import static li.vin.net.TestHelper.getSecondVehicleId;
import static li.vin.net.TestHelper.getVehicleId;

          @Override public void onNext(TimeSeries<Message> messageTimeSeries) {
            for (Message message : messageTimeSeries.getItems()) {
              assertTrue(message.id() != null && message.id().length() > 0);
              assertTrue(message.timestamp != null && message.timestamp.length() > 0);
            }

            if (messageTimeSeries.hasPrior()) {
              messageTimeSeries.loadPrior().toBlocking()
                  .subscribe(new Subscriber<TimeSeries<Message>>() {
                @Override public void onCompleted() {

                }

                @Override public void onError(Throwable e) {
                  e.printStackTrace();
                  assertTrue(false);
                }

                @Override public void onNext(TimeSeries<Message> messageTimeSeries) {
                  for (Message message : messageTimeSeries.getItems()) {
                    assertTrue(message.id() != null && message.id().length() > 0);
                    assertTrue(message.timestamp != null && message.timestamp.length() > 0);
                  }
                }
              });
            }
          }
        });
  }
  @Test public void getPagedMessagesByVehicleId() {
    assertTrue(getVehicleId() != null);