/*
 * This file was automatically generated by EvoSuite
 * Mon Dec 09 23:59:13 GMT 2019
 */

package org.traccar.events;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import org.traccar.Context;
import org.traccar.database.IdentityManager;
import org.traccar.events.IgnitionEventHandler;
import org.traccar.model.Device;
import org.traccar.model.Network;
import org.traccar.model.Position;
import org.traccar.model.WifiAccessPoint;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) 
public class IgnitionEventHandler_ESTest extends IgnitionEventHandler_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      IgnitionEventHandler ignitionEventHandler0 = new IgnitionEventHandler();
      Position position0 = new Position();
      Network network0 = new Network();
      WifiAccessPoint wifiAccessPoint0 = new WifiAccessPoint();
      Integer integer0 = new Integer(0);
      wifiAccessPoint0.setSignalStrength(integer0);
      network0.addWifiAccessPoint(wifiAccessPoint0);
      Integer integer1 = new Integer(1686);
      Integer.sum(308, 0);
      Integer.getInteger("count");
      network0.setHomeMobileCountryCode(integer1);
      position0.setNetwork(network0);
      position0.setId(0L);
      position0.set("transferIndex", false);
      // Undeclared exception!
      try { 
        ignitionEventHandler0.analyzePosition(position0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.events.IgnitionEventHandler", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      IgnitionEventHandler ignitionEventHandler0 = new IgnitionEventHandler();
      Position position0 = new Position();
      position0.set("", 0);
      // Undeclared exception!
      try { 
        ignitionEventHandler0.analyzePosition(position0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.events.IgnitionEventHandler", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      IgnitionEventHandler ignitionEventHandler0 = new IgnitionEventHandler();
      Position position0 = new Position();
      position0.setOutdated(true);
      // Undeclared exception!
      try { 
        ignitionEventHandler0.analyzePosition(position0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.events.IgnitionEventHandler", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      IgnitionEventHandler ignitionEventHandler0 = new IgnitionEventHandler();
      IdentityManager identityManager0 = mock(IdentityManager.class, new ViolatedAssumptionAnswer());
      Context.init(identityManager0);
      IdentityManager identityManager1 = mock(IdentityManager.class, new ViolatedAssumptionAnswer());
      doReturn((Device) null, (Device) null).when(identityManager1).getDeviceById(anyLong());
      Context.init(identityManager1);
      Position position0 = new Position();
      ignitionEventHandler0.analyzePosition(position0);
      ignitionEventHandler0.analyzePosition(position0);
      position0.setAltitude((-1.0));
      // Undeclared exception!
      try { 
        ignitionEventHandler0.analyzePosition((Position) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.events.IgnitionEventHandler", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      IgnitionEventHandler ignitionEventHandler0 = new IgnitionEventHandler();
      Position position0 = new Position();
      // Undeclared exception!
      try { 
        ignitionEventHandler0.analyzePosition(position0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.events.IgnitionEventHandler", e);
      }
  }
}
