=str,htp clean up build warnings
- explicitly provide Unit values and place parens around tuple creation - remove structural type usage in TestUtils - fix Java double-casts - use unused Java values by asserting their non-nullness - work around inability to place case class in trait (scripted test) The remaining warnings about using private types in public methods are bogus as reported in https://issues.scala-lang.org/browse/SI-9490.
This commit is contained in:
parent
ae83053a64
commit
68ba0643d6
58 changed files with 160 additions and 132 deletions
|
|
@ -11,13 +11,10 @@ import akka.http.javadsl.server.values.Parameters;
|
|||
import akka.http.javadsl.server.values.PathMatchers;
|
||||
import akka.http.javadsl.testkit.JUnitRouteTest;
|
||||
import akka.http.javadsl.testkit.TestRoute;
|
||||
import akka.japi.function.Function;
|
||||
import org.junit.Test;
|
||||
import scala.concurrent.ExecutionContext;
|
||||
import scala.concurrent.Future;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public class HandlerExampleDocTest extends JUnitRouteTest {
|
||||
@Test
|
||||
public void testSimpleHandler() {
|
||||
|
|
@ -25,6 +22,7 @@ public class HandlerExampleDocTest extends JUnitRouteTest {
|
|||
class TestHandler extends akka.http.javadsl.server.AllDirectives {
|
||||
//#simple-handler
|
||||
Handler handler = new Handler() {
|
||||
static final long serialVersionUID = 1L;
|
||||
@Override
|
||||
public RouteResult apply(RequestContext ctx) {
|
||||
return ctx.complete("This was a " + ctx.request().method().value() +
|
||||
|
|
@ -75,6 +73,7 @@ public class HandlerExampleDocTest extends JUnitRouteTest {
|
|||
//#handler2
|
||||
final Handler2<Integer, Integer> multiply =
|
||||
new Handler2<Integer, Integer>() {
|
||||
static final long serialVersionUID = 1L;
|
||||
@Override
|
||||
public RouteResult apply(RequestContext ctx, Integer x, Integer y) {
|
||||
int result = x * y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue