row.locations = skuLocationsMap[sku].reduce(function (accum, curr) { return accum + (accum !== '' ? ', ' : '') + curr;}, '');
The above is a complex way of doing Array.prototype.join() but it's helpful for remembering how reduce works.
row.locations = skuLocationsMap[sku].reduce(function (accum, curr) { return accum + (accum !== '' ? ', ' : '') + curr;}, '');
1 @Test
2 def testNullHandlerCallsStart(): Unit = {
3 predictor.setHandler(null)
4 when(predictor.log == null).thenAnswer(new Answer[Logger] {
5 def answer(invocation: InvocationOnMock): Logger = {
6 LoggerFactory.getLogger("Predictor")
7 }
8 })
9 when(predictor.enqueueEvent(any())).thenCallRealMethod()
10 val deactivation = new UnitUpdateNotification(unit, unit.updateStatus(Status.INACTIVE, Action.DEACTIVATED, "damaged", "user"))
11 callback.handle(deactivation)
12 verify(predictor).enqueueEvent(any(classOf[Event]))
13 }
newArrayList(string)Super handy method from Google Collections
Upon submitting a request to my service like CURL -X POST http://localhost:8600/a/b/c -d '{"assignmentId[]":[12345]}' ...