package com.lucidchart.piezo.admin.controllers

import org.quartz.{SimpleScheduleBuilder, TriggerBuilder, JobBuilder, Scheduler}
import com.lucidchart.piezo.jobs.monitoring.HeartBeat

/**
  */
object TestUtil {
  val jobGroup = "testJobGroup"
  val jobName = "testJobName"
  val triggerGroup = "testTriggerGroup"
  val triggerName = "testTriggerName"

  def createJob(scheduler: Scheduler) = {
    val jobDetail = JobBuilder.newJob(classOf[HeartBeat])
      .withIdentity(jobName, jobGroup)
      .withDescription("test job description")
      .build()
    val trigger = TriggerBuilder.newTrigger
      .withIdentity(triggerName, triggerGroup)
      .withDescription("test trigger description")
      .withSchedule(
      SimpleScheduleBuilder.simpleSchedule
        .withIntervalInSeconds(5)
        .withRepeatCount(1))
        .withDescription("test schedule description")
      .build()
    scheduler.deleteJob(jobDetail.getKey())
    scheduler.scheduleJob(jobDetail, trigger)
  }
}

package com.lucidchart.piezo.admin.controllers

import org.quartz.{SimpleScheduleBuilder, TriggerBuilder, JobBuilder, Scheduler}
import com.lucidchart.piezo.jobs.monitoring.HeartBeat

/**
  */
object TestUtil {
  val jobGroup = "testJobGroup"
  val jobName = "testJobName"
  val triggerGroup = "testTriggerGroup"
  val triggerName = "testTriggerName"

  def createJob(scheduler: Scheduler) = {
    val jobDetail = JobBuilder.newJob(classOf[HeartBeat]).withIdentity(jobName, jobGroup).build()
    val trigger = TriggerBuilder.newTrigger
      .withIdentity(triggerName, triggerGroup)
      .withDescription("test job description")
      .withSchedule(
      SimpleScheduleBuilder.simpleSchedule
        .withIntervalInSeconds(5)
        .withRepeatCount(1))
        .withDescription("test trigger description")
      .build()
    scheduler.deleteJob(jobDetail.getKey())
    scheduler.scheduleJob(jobDetail, trigger)
  }
}

--- 
+++ 
@@ -12,15 +12,18 @@
   val triggerName = "testTriggerName"
 
   def createJob(scheduler: Scheduler) = {
-    val jobDetail = JobBuilder.newJob(classOf[HeartBeat]).withIdentity(jobName, jobGroup).build()
+    val jobDetail = JobBuilder.newJob(classOf[HeartBeat])
+      .withIdentity(jobName, jobGroup)
+      .withDescription("test job description")
+      .build()
     val trigger = TriggerBuilder.newTrigger
       .withIdentity(triggerName, triggerGroup)
-      .withDescription("test job description")
+      .withDescription("test trigger description")
       .withSchedule(
       SimpleScheduleBuilder.simpleSchedule
         .withIntervalInSeconds(5)
         .withRepeatCount(1))
-        .withDescription("test trigger description")
+        .withDescription("test schedule description")
       .build()
     scheduler.deleteJob(jobDetail.getKey())
     scheduler.scheduleJob(jobDetail, trigger)
Update job data setup in test utils to try to fix build part 2.
