|
|
|
@ -17,12 +17,17 @@
@@ -17,12 +17,17 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.cloud.gateway.route; |
|
|
|
|
|
|
|
|
|
import org.junit.Rule; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.rules.ExpectedException; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
|
|
|
|
|
public class RouteTests { |
|
|
|
|
|
|
|
|
|
@Rule |
|
|
|
|
public ExpectedException exception = ExpectedException.none(); |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void defeaultHttpPort() { |
|
|
|
|
Route route = Route.async().id("1") |
|
|
|
@ -47,7 +52,6 @@ public class RouteTests {
@@ -47,7 +52,6 @@ public class RouteTests {
|
|
|
|
|
.hasPort(443); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void fullUri() { |
|
|
|
|
Route route = Route.async().id("1") |
|
|
|
@ -59,4 +63,12 @@ public class RouteTests {
@@ -59,4 +63,12 @@ public class RouteTests {
|
|
|
|
|
.hasScheme("http") |
|
|
|
|
.hasPort(8080); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nullScheme() { |
|
|
|
|
exception.expect(IllegalArgumentException.class); |
|
|
|
|
Route.async().id("1") |
|
|
|
|
.predicate(exchange -> true) |
|
|
|
|
.uri("/pathonly"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|