Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
beineng committed Jan 3, 2019
1 parent 110af05 commit da9ebc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,4 @@ object Story extends Logging {
}
)
.named(taskName)

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import akka.stream._
import akka.stream.scaladsl.Flow
import akka.util.Timeout
import com.thenetcircle.event_bus.context.{TaskBuildingContext, TaskRunningContext}
import com.thenetcircle.event_bus.interfaces.EventStatus.{FAIL, NORM, TOFB}
import com.thenetcircle.event_bus.interfaces.EventStatus.{NORM, TOFB}
import com.thenetcircle.event_bus.interfaces.{Event, EventStatus, SinkTask, SinkTaskBuilder}
import com.thenetcircle.event_bus.misc.{Logging, Util}
import com.thenetcircle.event_bus.tasks.http.HttpSink.RetrySender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ package com.thenetcircle.event_bus.story
import akka.NotUsed
import akka.stream.Attributes
import akka.stream.scaladsl.{Flow, Source}
import com.thenetcircle.event_bus.TestBase
import com.thenetcircle.event_bus.IntegrationTestBase
import com.thenetcircle.event_bus.interfaces.EventStatus._
import com.thenetcircle.event_bus.story.Story.Payload

import scala.concurrent.{Await, Future}
import scala.concurrent.Future
import scala.util.Random

class StoryTest extends TestBase {
class StoryTest extends IntegrationTestBase {

behavior of "Story"

it should "make sure the message order after wrapping tasks" in {

val slowTask: Flow[Payload, Payload, NotUsed] = Flow[Payload]
.mapAsync(2) { pl =>
val slowTask1: Flow[Payload, Payload, NotUsed] = Flow[Payload]
.mapAsync(1) { pl =>
Future {
Thread.sleep(Random.nextInt(1000))
pl
Expand All @@ -44,7 +44,7 @@ class StoryTest extends TestBase {
val slowTask2: Flow[Payload, Payload, NotUsed] = Flow[Payload].async
.addAttributes(Attributes.inputBuffer(1, 1))

val wrappedTask: Flow[Payload, Payload, NotUsed] = Story.wrapTask(slowTask2, "testTask")
val wrappedTask: Flow[Payload, Payload, NotUsed] = Story.wrapTask(slowTask1, "testTask")

val testSource: Source[Payload, NotUsed] = Source(
List(
Expand Down

0 comments on commit da9ebc6

Please sign in to comment.