Example usage for java.time Duration ofMinutes

List of usage examples for java.time Duration ofMinutes

Introduction

In this page you can find the example usage for java.time Duration ofMinutes.

Prototype

public static Duration ofMinutes(long minutes) 

Source Link

Document

Obtains a Duration representing a number of standard minutes.

Usage

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void get() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    this.spaceId.then(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName))
            .then(applicationId -> Mono.when(Mono.just(applicationId),
                    requestGetApplication(this.cloudFoundryClient, applicationId)))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void list() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    this.spaceId/*  ww  w.  ja  va2  s.c  om*/
            .then(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId,
                    applicationName))
            .then(applicationId -> Mono.when(Mono.just(applicationId),
                    PaginationUtils
                            .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                    .list(ListApplicationsRequest.builder().page(page).build()))
                            .filter(resource -> ResourceUtils.getId(resource).equals(applicationId)).single()
                            .cast(AbstractApplicationResource.class)))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listFilterByDiego() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    this.spaceId.then(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName))
            .then(applicationId -> Mono
                    .when(Mono.just(applicationId),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .list(ListApplicationsRequest.builder().diego(true).page(page)
                                                    .build()))
                                    .filter(resource -> ResourceUtils.getId(resource).equals(applicationId))
                                    .single().cast(AbstractApplicationResource.class)))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listFilterByName() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    this.spaceId.then(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName))
            .then(applicationId -> Mono
                    .when(Mono.just(applicationId),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .list(ListApplicationsRequest.builder().name(applicationName)
                                                    .page(page).build()))
                                    .filter(resource -> ResourceUtils.getId(resource).equals(applicationId))
                                    .single().cast(AbstractApplicationResource.class)))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listFilterByOrganizationId() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    Mono.when(this.organizationId,
            this.spaceId.then(
                    spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName)))
            .then(function((organizationId, applicationId) -> Mono.when(Mono.just(applicationId),
                    PaginationUtils//  w  ww  .ja  v  a 2 s  .co  m
                            .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                    .list(ListApplicationsRequest.builder().organizationId(organizationId)
                                            .page(page).build()))
                            .filter(resource -> ResourceUtils.getId(resource).equals(applicationId)).single()
                            .cast(AbstractApplicationResource.class))))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listFilterBySpaceId() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();

    this.spaceId/* w  w  w . j a v  a 2s. c  om*/
            .then(spaceId -> Mono.when(Mono.just(spaceId),
                    createApplicationId(this.cloudFoundryClient, spaceId, applicationName)))
            .then(function(
                    (spaceId, applicationId) -> Mono.when(Mono.just(applicationId),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .list(ListApplicationsRequest.builder().spaceId(spaceId).page(page)
                                                    .build()))
                                    .filter(resource -> ResourceUtils.getId(resource).equals(applicationId))
                                    .single().cast(AbstractApplicationResource.class))))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listFilterByStackId() {
    String applicationName = this.nameFactory.getApplicationName();

    Mono.when(this.stackId,
            this.spaceId
                    .then(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName)))
            .then(function(//from   ww w. j av a  2s . co  m
                    (stackId, applicationId) -> Mono.when(Mono.just(applicationId),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .list(ListApplicationsRequest.builder().stackId(stackId).page(page)
                                                    .build()))
                                    .filter(resource -> ResourceUtils.getId(resource).equals(applicationId))
                                    .single().cast(AbstractApplicationResource.class))))
            .as(StepVerifier::create).consumeNextWith(applicationIdAndNameEquality(applicationName))
            .expectComplete().verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listRoutes() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();
    String domainName = this.nameFactory.getDomainName();

    Mono.when(this.organizationId, this.spaceId)
            .then(function((organizationId, spaceId) -> Mono.when(Mono.just(organizationId), Mono.just(spaceId),
                    createApplicationId(this.cloudFoundryClient, spaceId, applicationName))))
            .then(function((organizationId, spaceId, applicationId) -> Mono.when(Mono.just(applicationId),
                    createApplicationRoute(this.cloudFoundryClient, organizationId, spaceId, domainName,
                            applicationId))))
            .then(function(/*ww  w  .  j  a  va 2 s  .c om*/
                    (applicationId, routeResponse) -> Mono.when(Mono.just(ResourceUtils.getId(routeResponse)),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .listRoutes(ListApplicationRoutesRequest.builder()
                                                    .applicationId(applicationId).page(page).build()))
                                    .single().map(ResourceUtils::getId))))
            .as(StepVerifier::create).consumeNextWith(tupleEquality()).expectComplete()
            .verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listRoutesFilterByDomainId() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();
    String domainName = this.nameFactory.getDomainName();

    Mono.when(this.organizationId, this.spaceId)
            .then(function((organizationId, spaceId) -> Mono.when(Mono.just(organizationId), Mono.just(spaceId),
                    createApplicationId(this.cloudFoundryClient, spaceId, applicationName))))
            .then(function((organizationId, spaceId, applicationId) -> Mono.when(Mono.just(applicationId),
                    createApplicationRoute(this.cloudFoundryClient, organizationId, spaceId, domainName,
                            applicationId))))
            .then(function(//  w ww.  j  av a2s.co  m
                    (applicationId, routeResponse) -> Mono.when(Mono.just(ResourceUtils.getId(routeResponse)),
                            PaginationUtils
                                    .requestClientV2Resources(page -> this.cloudFoundryClient.applicationsV2()
                                            .listRoutes(ListApplicationRoutesRequest.builder()
                                                    .applicationId(applicationId)
                                                    .domainId(ResourceUtils.getEntity(routeResponse)
                                                            .getDomainId())
                                                    .page(page).build()))
                                    .single().map(ResourceUtils::getId))))
            .as(StepVerifier::create).consumeNextWith(tupleEquality()).expectComplete()
            .verify(Duration.ofMinutes(5));
}

From source file:org.cloudfoundry.client.v2.ApplicationsTest.java

@Test
public void listRoutesFilterByHost() throws TimeoutException, InterruptedException {
    String applicationName = this.nameFactory.getApplicationName();
    String domainName = this.nameFactory.getDomainName();

    Mono.when(this.organizationId, this.spaceId)
            .then(function((organizationId, spaceId) -> Mono.when(Mono.just(organizationId), Mono.just(spaceId),
                    createApplicationId(this.cloudFoundryClient, spaceId, applicationName))))
            .then(function((organizationId, spaceId, applicationId) -> Mono.when(Mono.just(applicationId),
                    createApplicationRoute(this.cloudFoundryClient, organizationId, spaceId, domainName,
                            applicationId))))
            .then(function(/*from  w  w w .ja v  a2s. c om*/
                    (applicationId, routeResponse) -> Mono
                            .when(Mono.just(ResourceUtils.getId(routeResponse)),
                                    PaginationUtils
                                            .requestClientV2Resources(
                                                    page -> this.cloudFoundryClient.applicationsV2()
                                                            .listRoutes(ListApplicationRoutesRequest.builder()
                                                                    .applicationId(applicationId)
                                                                    .host(ResourceUtils.getEntity(routeResponse)
                                                                            .getHost())
                                                                    .page(page).build()))
                                            .single().map(ResourceUtils::getId))))
            .as(StepVerifier::create).consumeNextWith(tupleEquality()).expectComplete()
            .verify(Duration.ofMinutes(5));
}