* =htp #20915 fix too small timing issue in DirectivesSpec * applying scalariform reformatting that keeps popping up
This commit is contained in:
parent
b4cd30cf94
commit
54ecf32d2b
7 changed files with 119 additions and 113 deletions
|
|
@ -14,6 +14,9 @@ import akka.stream.javadsl.Source;
|
|||
import akka.util.ByteString;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import scala.concurrent.duration.Duration;
|
||||
import scala.concurrent.duration.FiniteDuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
|
|
@ -21,6 +24,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class FileUploadDirectivesExamplesTest extends JUnitRouteTest {
|
||||
|
|
@ -48,8 +52,10 @@ public class FileUploadDirectivesExamplesTest extends JUnitRouteTest {
|
|||
"1,5,7\n11,13,17"), filenameMapping));
|
||||
|
||||
// test:
|
||||
testRoute(route).run(HttpRequest.POST("/").withEntity(
|
||||
multipartForm.toEntity(HttpCharsets.UTF_8, BodyPartRenderer
|
||||
testRoute(route).run(HttpRequest.POST("/")
|
||||
.withEntity(
|
||||
multipartForm.toEntity(HttpCharsets.UTF_8,
|
||||
BodyPartRenderer
|
||||
.randomBoundaryWithDefaults())))
|
||||
.assertStatusCode(StatusCodes.OK);
|
||||
//#
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ abstract class RouteTest extends AllDirectives {
|
|||
implicit def materializer: Materializer
|
||||
implicit def executionContext: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
protected def awaitDuration: FiniteDuration = 500.millis
|
||||
protected def awaitDuration: FiniteDuration = 3.seconds
|
||||
|
||||
protected def defaultHostInfo: DefaultHostInfo = DefaultHostInfo(Host.create("example.com"), false)
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class MethodDirectivesSpec extends RoutingSpec {
|
|||
Head() ~> headRoute ~> check {
|
||||
status shouldEqual StatusCodes.OK
|
||||
|
||||
val lengthF = response._3.dataBytes.runFold(0)((c, _) => c+1)
|
||||
val lengthF = response._3.dataBytes.runFold(0)((c, _) ⇒ c + 1)
|
||||
val length = Await.result(lengthF, Duration(100, "millis"))
|
||||
length shouldEqual 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ object Credentials {
|
|||
*
|
||||
* See also [[EnhancedString#secure_==]], for more information.
|
||||
*/
|
||||
def verify(secret: String): Boolean = verify(secret, x => x)
|
||||
def verify(secret: String): Boolean = verify(secret, x ⇒ x)
|
||||
}
|
||||
|
||||
def apply(cred: Option[HttpCredentials]): Credentials = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue