Skip to content

Commit

Permalink
when server does not provide router API then skip depending tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokowandtg committed Nov 26, 2024
1 parent 5e81c89 commit ac773a3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.cloudfoundry.operations.domains.ShareDomainRequest;
import org.cloudfoundry.operations.domains.UnshareDomainRequest;
import org.cloudfoundry.operations.organizations.CreateOrganizationRequest;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -101,6 +102,7 @@ public void createShared() {

@Test
public void createSharedTcp() {
Assumptions.assumeTrue(super.serverUsesRouting());
String domainName = this.nameFactory.getDomainName();

this.cloudFoundryOperations
Expand Down Expand Up @@ -138,6 +140,7 @@ public void list() {

@Test
public void listRouterGroups() {
Assumptions.assumeTrue(super.serverUsesRouting());
this.cloudFoundryOperations
.domains()
.listRouterGroups()
Expand All @@ -150,6 +153,7 @@ public void listRouterGroups() {

@Test
public void listTcp() {
Assumptions.assumeTrue(super.serverUsesRouting());
String domainName = this.nameFactory.getDomainName();

requestCreateTcpDomain(this.cloudFoundryOperations, domainName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.cloudfoundry.operations.routes.UnmapRouteRequest;
import org.cloudfoundry.operations.services.BindRouteServiceInstanceRequest;
import org.cloudfoundry.operations.services.CreateUserProvidedServiceInstanceRequest;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -154,6 +155,7 @@ public void create() {

@Test
public void createRouteTcpAssignedPort() {
Assumptions.assumeTrue(super.serverUsesRouting());
String domainName = this.nameFactory.getDomainName();
Integer port = this.nameFactory.getPort();

Expand All @@ -171,6 +173,7 @@ public void createRouteTcpAssignedPort() {

@Test
public void createRouteTcpRandomPort() {
Assumptions.assumeTrue(super.serverUsesRouting());
String domainName = this.nameFactory.getDomainName();

requestCreateSharedDomain(this.cloudFoundryOperations, domainName, DEFAULT_ROUTER_GROUP)
Expand Down Expand Up @@ -305,6 +308,7 @@ public void deleteOrphanedRoutes() {

@Test
public void deleteTcpRoute() {
Assumptions.assumeTrue(super.serverUsesRouting());
String domainName = this.nameFactory.getDomainName();

requestCreateSharedDomain(this.cloudFoundryOperations, domainName, DEFAULT_ROUTER_GROUP)
Expand Down Expand Up @@ -522,6 +526,7 @@ public void mapNoPath() throws IOException {

@Test
public void mapTcpRoute() throws IOException {
Assumptions.assumeTrue(super.serverUsesRouting());
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();

Expand Down Expand Up @@ -553,6 +558,7 @@ public void mapTcpRoute() throws IOException {

@Test
public void mapTcpRouteTwice() throws IOException {
Assumptions.assumeTrue(super.serverUsesRouting());
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();

Expand Down Expand Up @@ -680,6 +686,7 @@ public void unmapNoPath() throws IOException {

@Test
public void unmapTcpRoute() throws IOException {
Assumptions.assumeTrue(super.serverUsesRouting());
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.cloudfoundry.routing.v1.routergroups.RouterGroup;
import org.cloudfoundry.routing.v1.routergroups.UpdateRouterGroupRequest;
import org.cloudfoundry.routing.v1.routergroups.UpdateRouterGroupResponse;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Mono;
Expand All @@ -37,6 +38,7 @@ public final class RouterGroupsTest extends AbstractIntegrationTest {

@Test
public void list() {
Assumptions.assumeTrue(super.serverUsesRouting());
this.routingClient
.routerGroups()
.list(ListRouterGroupsRequest.builder().build())
Expand All @@ -51,6 +53,7 @@ public void list() {

@Test
public void update() {
Assumptions.assumeTrue(super.serverUsesRouting());
getRouterGroupId(this.routingClient, DEFAULT_ROUTER_GROUP)
.flatMap(
routerGroupId ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.cloudfoundry.routing.v1.tcproutes.TcpRoute;
import org.cloudfoundry.routing.v1.tcproutes.TcpRouteConfiguration;
import org.cloudfoundry.routing.v1.tcproutes.TcpRouteDeletion;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Flux;
Expand All @@ -48,6 +49,7 @@ public final class TcpRoutesTest extends AbstractIntegrationTest {

@Test
public void create() {
Assumptions.assumeTrue(super.serverUsesRouting());
String backendIp = this.nameFactory.getIpAddress();
Integer backendPort = this.nameFactory.getPort();
Integer port = this.nameFactory.getPort();
Expand Down Expand Up @@ -82,6 +84,7 @@ public void create() {

@Test
public void delete() {
Assumptions.assumeTrue(super.serverUsesRouting());
String backendIp = this.nameFactory.getIpAddress();
Integer backendPort = this.nameFactory.getPort();
Integer port = this.nameFactory.getPort();
Expand Down Expand Up @@ -122,6 +125,7 @@ public void delete() {

@Test
public void events() {
Assumptions.assumeTrue(super.serverUsesRouting());
String backendIp = this.nameFactory.getIpAddress();
Integer backendPort = this.nameFactory.getPort();
Integer port = this.nameFactory.getPort();
Expand Down Expand Up @@ -158,6 +162,7 @@ public void events() {

@Test
public void list() {
Assumptions.assumeTrue(super.serverUsesRouting());
String backendIp = this.nameFactory.getIpAddress();
Integer backendPort = this.nameFactory.getPort();
Integer port = this.nameFactory.getPort();
Expand Down

0 comments on commit ac773a3

Please sign in to comment.