Skip to content

Commit

Permalink
Not relying anymore on live httpbin.org
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Jun 22, 2023
1 parent b020fec commit fe90288
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void findAll() {
public void save() {
SRARoute route = entityFactory.newEntity(SRARoute.class);
route.setName("just for test");
route.setTarget(URI.create("http://httpbin.org:80"));
route.setTarget(URI.create("http://localhost:80"));
route.setType(SRARouteType.PUBLIC);
route.setPredicates(List.of(new SRARoutePredicate.Builder().
factory(SRARoutePredicateFactory.METHOD).args(HttpMethod.GET).build()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void findAll() {
public void createUpdateDelete() {
SRARouteTO route = new SRARouteTO();
route.setName("just for test");
route.setTarget(URI.create("http://httpbin.org:80"));
route.setTarget(URI.create("http://localhost:80"));
route.getPredicates().add(new SRARoutePredicate.Builder().
factory(SRARoutePredicateFactory.METHOD).args(HttpMethod.GET).build());
route.getFilters().add(new SRARouteFilter.Builder().
Expand Down Expand Up @@ -114,7 +114,7 @@ public void exceptions() {
assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
}

route.setTarget(URI.create("http://httpbin.org:80"));
route.setTarget(URI.create("http://localhost:80"));
Response response = SRA_ROUTE_SERVICE.create(route);
assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusInfo().getStatusCode());

Expand Down
35 changes: 35 additions & 0 deletions fit/wa-reference/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,41 @@ under the License.
</executions>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skip>${skipTests}</skip>
<images>
<image>
<name>kennethreitz/httpbin</name>
<run>
<ports>
<port>80:80</port>
</ports>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>start-httpbin</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-httpbin</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>remove</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static void sraRouteSetup() {

SRARouteTO publicRoute = new SRARouteTO();
publicRoute.setName("public");
publicRoute.setTarget(URI.create("http://httpbin.org:80"));
publicRoute.setTarget(URI.create("http://localhost:80"));
publicRoute.setType(SRARouteType.PUBLIC);
publicRoute.setCsrf(false);
publicRoute.getPredicates().add(new SRARoutePredicate.Builder().
Expand All @@ -99,7 +99,7 @@ public static void sraRouteSetup() {

SRARouteTO protectedRoute = new SRARouteTO();
protectedRoute.setName("protected");
protectedRoute.setTarget(URI.create("http://httpbin.org:80"));
protectedRoute.setTarget(URI.create("http://localhost:80"));
protectedRoute.setType(SRARouteType.PROTECTED);
protectedRoute.setCsrf(false);
protectedRoute.getPredicates().add(new SRARoutePredicate.Builder().
Expand All @@ -114,7 +114,7 @@ public static void sraRouteSetup() {

SRARouteTO logoutRoute = new SRARouteTO();
logoutRoute.setName("logout");
logoutRoute.setTarget(URI.create("http://httpbin.org:80"));
logoutRoute.setTarget(URI.create("http://localhost:80"));
logoutRoute.setType(SRARouteType.PROTECTED);
logoutRoute.setLogout(true);
logoutRoute.getPredicates().add(new SRARoutePredicate.Builder().
Expand All @@ -128,7 +128,7 @@ public static void sraRouteSetup() {

SRARouteTO postLogout = new SRARouteTO();
postLogout.setName("postLogout");
postLogout.setTarget(URI.create("http://httpbin.org:80"));
postLogout.setTarget(URI.create("http://localhost:80"));
postLogout.setType(SRARouteType.PUBLIC);
postLogout.getPredicates().add(new SRARoutePredicate.Builder().
factory(SRARoutePredicateFactory.PATH).args("/logout").build());
Expand Down

0 comments on commit fe90288

Please sign in to comment.