/*
 * This file was automatically generated by EvoSuite
 * Mon Dec 09 22:23:10 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 java.io.FileNotFoundException;
import java.util.Map;
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.Event;
import org.traccar.model.Position;

@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();
      // 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();
      IdentityManager identityManager0 = mock(IdentityManager.class, new ViolatedAssumptionAnswer());
      doReturn((Device) null, (Device) null, (Device) null, (Device) null, (Device) null).when(identityManager0).getDeviceById(anyLong());
      Context.init(identityManager0);
      Position position0 = new Position();
      position0.setType("Fl");
      ignitionEventHandler0.analyzePosition(position0);
      Position position1 = new Position();
      Event event0 = new Event("powerOff", 228L);
      Map<String, Object> map0 = event0.getAttributes();
      position0.setAttributes(map0);
      ignitionEventHandler0.analyzePosition(position1);
      ignitionEventHandler0.analyzePosition(position1);
      ignitionEventHandler0.analyzePosition(position1);
      ignitionEventHandler0.analyzePosition(position1);
      ignitionEventHandler0.analyzePosition(position1);
      String[] stringArray0 = new String[8];
      stringArray0[0] = "lowspeed";
      stringArray0[1] = "sat";
      stringArray0[2] = "hardAcceleration";
      stringArray0[3] = "approximate";
      stringArray0[4] = "gpsAntennaCut";
      stringArray0[5] = "h(";
      stringArray0[6] = "accident";
      stringArray0[7] = "fuel";
      try { 
        Context.init(stringArray0);
        fail("Expecting exception: FileNotFoundException");
      
      } catch(FileNotFoundException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.evosuite.runtime.mock.java.io.MockFileInputStream", e);
      }
  }
}
