=htj move directive tests into own package

This commit is contained in:
Johannes Rudolph 2015-04-23 11:23:49 +02:00 committed by Mathias
parent 79e24c5976
commit 30e4acacfa
3 changed files with 19 additions and 14 deletions

View file

@ -2,7 +2,7 @@
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.http.javadsl.server;
package akka.http.javadsl.server.directives;
import org.junit.Test;
import scala.Option;
@ -10,6 +10,7 @@ import scala.concurrent.Future;
import akka.http.javadsl.model.HttpRequest;
import akka.http.javadsl.model.headers.Authorization;
import akka.http.javadsl.testkit.*;
import akka.http.javadsl.server.*;
import static akka.http.javadsl.server.Directives.*;
public class AuthenticationDirectivesTest extends JUnitRouteTest {

View file

@ -2,7 +2,7 @@
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.http.javadsl.server;
package akka.http.javadsl.server.directives;
import static akka.http.javadsl.server.Directives.*;
@ -11,6 +11,7 @@ import akka.http.javadsl.model.HttpRequest;
import akka.http.javadsl.model.headers.AcceptEncoding;
import akka.http.javadsl.model.headers.ContentEncoding;
import akka.http.javadsl.model.headers.HttpEncodings;
import akka.http.javadsl.server.Coder;
import akka.stream.ActorMaterializer;
import akka.util.ByteString;
import org.junit.*;

View file

@ -2,26 +2,29 @@
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.http.javadsl.server;
package akka.http.javadsl.server.directives;
import static akka.http.javadsl.server.Directives.*;
import akka.http.javadsl.testkit.*;
import akka.http.scaladsl.model.HttpRequest;
import org.junit.Test;
import java.util.List;
import java.util.UUID;
import akka.http.javadsl.server.*;
import akka.http.javadsl.testkit.*;
import akka.http.scaladsl.model.HttpRequest;
import static akka.http.javadsl.server.Directives.*;
public class PathDirectivesTest extends JUnitRouteTest {
@Test
public void testPathPrefixAndPath() {
TestRoute route =
testRoute(
pathPrefix("pet").route(
path("cat").route(complete("The cat!")),
path("dog").route(complete("The dog!")),
pathSingleSlash().route(complete("Here are only pets."))
)
pathPrefix("pet").route(
path("cat").route(complete("The cat!")),
path("dog").route(complete("The dog!")),
pathSingleSlash().route(complete("Here are only pets."))
)
);
route.run(HttpRequest.GET("/pet/"))
@ -41,9 +44,9 @@ public class PathDirectivesTest extends JUnitRouteTest {
public void testRawPathPrefix() {
TestRoute route1 =
testRoute(
rawPathPrefix(PathMatchers.SLASH(), "pet", PathMatchers.SLASH(), "", PathMatchers.SLASH(), "cat").route(
complete("The cat!")
)
rawPathPrefix(PathMatchers.SLASH(), "pet", PathMatchers.SLASH(), "", PathMatchers.SLASH(), "cat").route(
complete("The cat!")
)
);
route1.run(HttpRequest.GET("/pet//cat"))