Updating to ScalaTest 3.0.0 and ScalaCheck 1.13.2
This commit is contained in:
parent
0ed4a2aae9
commit
5e830323f6
27 changed files with 213 additions and 201 deletions
|
|
@ -18,6 +18,7 @@ import akka.http.javadsl.testkit.JUnitRouteTest;
|
|||
import akka.stream.Materializer;
|
||||
import akka.stream.javadsl.Flow;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
|
@ -67,8 +68,8 @@ public class CustomHttpMethodExamplesTest extends JUnitRouteTest {
|
|||
CompletionStage<HttpResponse> response = http.singleRequest(request, materializer);
|
||||
//#customHttpMethod
|
||||
|
||||
assertResult(StatusCodes.OK, response.toCompletableFuture().get().status());
|
||||
assertResult(
|
||||
assertEquals(StatusCodes.OK, response.toCompletableFuture().get().status());
|
||||
assertEquals(
|
||||
"This is a BOLT request.",
|
||||
response.toCompletableFuture().get().entity().toStrict(3000, materializer).toCompletableFuture().get().getData().utf8String()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import akka.util.ByteString;
|
|||
import com.typesafe.config.Config;
|
||||
import com.typesafe.config.ConfigFactory;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -68,16 +69,16 @@ public class RangeDirectivesExamplesTest extends JUnitRouteTest {
|
|||
try {
|
||||
final List<Multipart.ByteRanges.BodyPart> bodyParts =
|
||||
completionStage.toCompletableFuture().get(3, TimeUnit.SECONDS);
|
||||
assertResult(2, bodyParts.toArray().length);
|
||||
assertEquals(2, bodyParts.toArray().length);
|
||||
|
||||
final Multipart.ByteRanges.BodyPart part1 = bodyParts.get(0);
|
||||
assertResult(bytes028Range, part1.getContentRange());
|
||||
assertResult(ByteString.fromString("ABC"),
|
||||
assertEquals(bytes028Range, part1.getContentRange());
|
||||
assertEquals(ByteString.fromString("ABC"),
|
||||
part1.toStrict(1000, materializer).toCompletableFuture().get().getEntity().getData());
|
||||
|
||||
final Multipart.ByteRanges.BodyPart part2 = bodyParts.get(1);
|
||||
assertResult(bytes678Range, part2.getContentRange());
|
||||
assertResult(ByteString.fromString("GH"),
|
||||
assertEquals(bytes678Range, part2.getContentRange());
|
||||
assertEquals(ByteString.fromString("GH"),
|
||||
part2.toStrict(1000, materializer).toCompletableFuture().get().getEntity().getData());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class GraphDSLDocTest extends AbstractJavaTest {
|
|||
);
|
||||
// unconnected zip.out (!) => "The inlets [] and outlets [] must correspond to the inlets [] and outlets [ZipWith2.out]"
|
||||
//#simple-graph
|
||||
fail("expected IllegalArgumentException");
|
||||
org.junit.Assert.fail("expected IllegalArgumentException");
|
||||
} catch (IllegalArgumentException e) {
|
||||
assertTrue(e != null && e.getMessage() != null && e.getMessage().contains("must correspond to"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue