Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing test references.
  • Loading branch information
alexflav23 committed Nov 18, 2018
commit 630dda07a1b08b069f85d1c88e64d7a7c564d6aa
19 changes: 0 additions & 19 deletions util-samplers/src/test/scala/com/outworkers/util/Membership.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
*/
package com.outworkers.util.empty

import org.outworkers.domain.test.{NestedCollections, SimpleFoo}
import org.outworkers.domain.test._
import org.scalatest.{FlatSpec, Matchers}
import com.outworkers.util.macros.debug.Options.ShowTrees

class EmptyGeneratorsTest extends FlatSpec with Matchers {

Expand Down Expand Up @@ -45,7 +44,7 @@ class EmptyGeneratorsTest extends FlatSpec with Matchers {
}

it should "automatically derive a generator for a nested case class in a different package" in {
"val sample = gen[NestedOtherPackage]" should compile
"val sample = void[NestedOtherPackage]" should compile
}

it should "automatically derive a sample for a nested case class" in {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.outworkers.util.samplers

import org.outworkers.domain.test.{NestedCollections, SimpleFoo}
import org.scalatest.{FlatSpec, Matchers}
import org.outworkers.domain.test._

class GeneratorsTest extends FlatSpec with Matchers {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,33 @@
*/
package com.outworkers.util.samplers

import org.scalatest.{ FlatSpec, Matchers }
import org.outworkers.domain.test._
import org.scalatest.{FlatSpec, Matchers}

class TracerTests extends FlatSpec with Matchers {

it should "automatically derive a tracer for a simple type" in {
val sample = gen[User]
sample.trace()
"sample.trace()" should compile
}

it should "automatically derive a tracer for a nested type" in {
val sample = gen[NestedUser]
sample.trace()
"sample.trace()" should compile
}

it should "automatically derive a tracer for a nested tuple type" in {
val sample = gen[TupleRecord]
sample.trace()
"sample.trace()" should compile
}

it should "automatically derive a tracer for a nested tuple collection type" in {

implicit val mapTracer = new Tracers.MapLikeTracer[Map, String, String]()

val sample = gen[TupleCollectionRecord]
sample.trace()
"sample.trace()" should compile
}

it should "automatically derive a tracer for a type with collections" in {
val sample = gen[CollectionSample]
sample.trace()
"sample.trace()" should compile
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,63 @@ case class NestedCollections(
nestedListSet: List[Set[String]],
props: Map[String, List[String]],
doubleProps: Map[Set[String], List[String]]
)

import java.util.UUID

import org.outworkers.domain.test._

case class User(
id: UUID,
firstName: String,
lastName: String,
email: String
)

case class NestedUser(
timestamp: Long,
user: User
)

case class CollectionSample(
id: UUID,
firstName: String,
lastName: String,
sh: Short,
b: Byte,
name: String,
email: String,
tests: List[String],
sets: List[String],
map: Map[String, String],
emails: List[String],
opt: Option[Int]
)

case class TupleRecord(id: UUID, tp: (String, Long))

case class TupleCollectionRecord(id: UUID, tuples: List[(Int, String)])

case class NestedOtherPackage(
id: UUID,
otherPkg: OtherPackageExample,
emails: List[String]
)

trait RoleType extends Enumeration {
//represents built-in role types.
type RoleType = Value

val Leader = Value("leader")
val AllianceMember = Value("member")
}

object RoleType extends RoleType

case class Membership(
memberId: String,
entityType: String,
allianceId: String,
role: RoleType.Value = RoleType.Leader,
rankId: String
)