aboutsummaryrefslogtreecommitdiffstats
path: root/scalding/src
diff options
context:
space:
mode:
authorEllen Spertus <ellen.spertus@gmail.com>2018-08-14 19:28:54 -0700
committerEllen Spertus <ellen.spertus@gmail.com>2018-08-14 19:28:54 -0700
commit548b94e80f9920f092d218137bca067dd1b8671b (patch)
tree8e8de4701e2928436b21323888d3ee6d051ebc83 /scalding/src
parentd1833985ee4359733ff880a1e0aa75e60a3bc76d (diff)
downloadsandcrawler-548b94e80f9920f092d218137bca067dd1b8671b.tar.gz
sandcrawler-548b94e80f9920f092d218137bca067dd1b8671b.zip
Minor improvements.
Diffstat (limited to 'scalding/src')
-rw-r--r--scalding/src/test/scala/sandcrawler/ScoreJobTest.scala17
1 files changed, 7 insertions, 10 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
index e72eb7a..1c6ae83 100644
--- a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
+++ b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
@@ -143,17 +143,14 @@ class ScoreJobTest extends FlatSpec with Matchers {
JsonString.replace("<<TITLE>>", "Title 2")
)
- val Ok = Bytes.toBytes("200")
- val Bad = Bytes.toBytes("404")
+ val Ok = "200"
+ val Bad = "400"
+ val StatusCodes = List(Ok, Ok, Ok, Bad, Ok, Bad)
- val SampleData : List[List[Array[Byte]]] = List(
- List(Bytes.toBytes(Sha1Strings(0)), Bytes.toBytes(JsonStrings(0)), Ok),
- List(Bytes.toBytes(Sha1Strings(1)), Bytes.toBytes(JsonStrings(1)), Ok),
- List(Bytes.toBytes(Sha1Strings(2)), Bytes.toBytes(JsonStrings(2)), Ok),
- List(Bytes.toBytes(Sha1Strings(3)), Bytes.toBytes(JsonStrings(3)), Bad),
- List(Bytes.toBytes(Sha1Strings(4)), Bytes.toBytes(JsonStrings(4)), Ok),
- List(Bytes.toBytes(Sha1Strings(5)), Bytes.toBytes(JsonStrings(5)), Bad)
- )
+ val SampleData : List[List[Array[Byte]]] = (Sha1Strings, JsonStrings, StatusCodes)
+ .zipped
+ .toList
+ .map { case (sha, json, status) => List(Bytes.toBytes(sha), Bytes.toBytes(json), Bytes.toBytes(status)) }
JobTest("sandcrawler.ScoreJob")
.arg("test", "")