<commit_before>package pl.newicom.dddd.scheduling

import akka.actor.Props
import org.joda.time.DateTime
import pl.newicom.dddd.actor.PassivationConfig
import pl.newicom.dddd.aggregate.AggregateRootActorFactory
import pl.newicom.dddd.eventhandling.LocalPublisher
import pl.newicom.dddd.test.support.OfficeSpec
import pl.newicom.dddd.test.support.TestConfig.testSystem
import SchedulerSpec._
import scala.concurrent.duration._

object SchedulerSpec {
  implicit def actorFactory(implicit it: Duration = 1.minute): AggregateRootActorFactory[Scheduler] =
    new AggregateRootActorFactory[Scheduler] {
      override def props(pc: PassivationConfig): Props = Props(new Scheduler(pc, "test") with LocalPublisher)
      override def inactivityTimeout: Duration = it
    }

}

class SchedulerSpec extends OfficeSpec[Scheduler] {

  "Scheduling office" should {
    "schedule event" in {
      when {
        ScheduleEvent("test", null, DateTime.now(), null)
      }
      .expect { c =>
        EventScheduled(c.businessUnit, c.target, c.deadline.withSecondOfMinute(0).withMillisOfSecond(0), c.event)
      }
    }
  }

}<commit_msg>minor<commit_after>package pl.newicom.dddd.scheduling

import akka.actor.Props
import org.joda.time.DateTime
import pl.newicom.dddd.actor.PassivationConfig
import pl.newicom.dddd.aggregate.AggregateRootActorFactory
import pl.newicom.dddd.eventhandling.LocalPublisher
import pl.newicom.dddd.test.support.OfficeSpec
import pl.newicom.dddd.test.support.TestConfig.testSystem
import SchedulerSpec._
import scala.concurrent.duration._

object SchedulerSpec {
  implicit def actorFactory(implicit it: Duration = 1.minute): AggregateRootActorFactory[Scheduler] =
    new AggregateRootActorFactory[Scheduler] {
      override def props(pc: PassivationConfig): Props = Props(new Scheduler(pc, "test") with LocalPublisher)
      override def inactivityTimeout: Duration = it
    }

}

class SchedulerSpec extends OfficeSpec[Scheduler] {

  "Scheduling office" should {
    "schedule event" in {
      when {
        ScheduleEvent("test", null, DateTime.now(), null)
      }
      .expect { c =>
        EventScheduled(c.businessUnit, c.target, c.deadline.withSecondOfMinute(0).withMillisOfSecond(0), c.deadline.getMillis, c.event)
      }
    }
  }

}
{'fraction_non_alphanumeric': 0.0992063492063492, 'fraction_numerical': 0.0026455026455026454, 'mean_word_length': 4.376777251184834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5015526', 'n_tokens_mistral': 740, 'n_tokens_neox': 714, 'n_words': 135}