Search in sources :

Example 1 with RETURNS_SMART_NULLS

use of org.mockito.Mockito.RETURNS_SMART_NULLS in project cf-java-client by cloudfoundry.

the class PaginationUtilsTest method requestClientV3Empty.

@Test
public void requestClientV3Empty() {
    Packages packages = mock(Packages.class, RETURNS_SMART_NULLS);
    requestListPackagesEmpty(packages);
    PaginationUtils.requestClientV3Resources(page -> packages.list(ListPackagesRequest.builder().page(page).build())).as(StepVerifier::create).expectComplete().verify(Duration.ofSeconds(1));
}
Also used : ListPackagesResponse(org.cloudfoundry.client.v3.packages.ListPackagesResponse) StepVerifier(reactor.test.StepVerifier) ListSpacesRequest(org.cloudfoundry.client.v2.spaces.ListSpacesRequest) TimeoutException(java.util.concurrent.TimeoutException) SpaceEntity(org.cloudfoundry.client.v2.spaces.SpaceEntity) BitsData(org.cloudfoundry.client.v3.packages.BitsData) ListUsersRequest(org.cloudfoundry.uaa.users.ListUsersRequest) Spaces(org.cloudfoundry.client.v2.spaces.Spaces) ListPackagesRequest(org.cloudfoundry.client.v3.packages.ListPackagesRequest) SpaceResource(org.cloudfoundry.client.v2.spaces.SpaceResource) PackageResource(org.cloudfoundry.client.v3.packages.PackageResource) Duration(java.time.Duration) User(org.cloudfoundry.uaa.users.User) Name(org.cloudfoundry.uaa.users.Name) Packages(org.cloudfoundry.client.v3.packages.Packages) ListUsersResponse(org.cloudfoundry.uaa.users.ListUsersResponse) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) Meta(org.cloudfoundry.uaa.users.Meta) Mockito.when(org.mockito.Mockito.when) ListSpacesResponse(org.cloudfoundry.client.v2.spaces.ListSpacesResponse) Users(org.cloudfoundry.uaa.users.Users) RETURNS_SMART_NULLS(org.mockito.Mockito.RETURNS_SMART_NULLS) PackageType(org.cloudfoundry.client.v3.packages.PackageType) Pagination(org.cloudfoundry.client.v3.Pagination) PackageState(org.cloudfoundry.client.v3.packages.PackageState) Collections(java.util.Collections) Mockito.mock(org.mockito.Mockito.mock) Packages(org.cloudfoundry.client.v3.packages.Packages) StepVerifier(reactor.test.StepVerifier) Test(org.junit.Test)

Example 2 with RETURNS_SMART_NULLS

use of org.mockito.Mockito.RETURNS_SMART_NULLS in project cf-java-client by cloudfoundry.

the class PaginationUtilsTest method requestClientV2ResourcesEmpty.

@Test
public void requestClientV2ResourcesEmpty() {
    Spaces spaces = mock(Spaces.class, RETURNS_SMART_NULLS);
    requestListSpacesEmpty(spaces);
    PaginationUtils.requestClientV2Resources(page -> spaces.list(ListSpacesRequest.builder().page(page).build())).as(StepVerifier::create).expectComplete().verify(Duration.ofSeconds(1));
}
Also used : ListPackagesResponse(org.cloudfoundry.client.v3.packages.ListPackagesResponse) StepVerifier(reactor.test.StepVerifier) ListSpacesRequest(org.cloudfoundry.client.v2.spaces.ListSpacesRequest) TimeoutException(java.util.concurrent.TimeoutException) SpaceEntity(org.cloudfoundry.client.v2.spaces.SpaceEntity) BitsData(org.cloudfoundry.client.v3.packages.BitsData) ListUsersRequest(org.cloudfoundry.uaa.users.ListUsersRequest) Spaces(org.cloudfoundry.client.v2.spaces.Spaces) ListPackagesRequest(org.cloudfoundry.client.v3.packages.ListPackagesRequest) SpaceResource(org.cloudfoundry.client.v2.spaces.SpaceResource) PackageResource(org.cloudfoundry.client.v3.packages.PackageResource) Duration(java.time.Duration) User(org.cloudfoundry.uaa.users.User) Name(org.cloudfoundry.uaa.users.Name) Packages(org.cloudfoundry.client.v3.packages.Packages) ListUsersResponse(org.cloudfoundry.uaa.users.ListUsersResponse) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) Meta(org.cloudfoundry.uaa.users.Meta) Mockito.when(org.mockito.Mockito.when) ListSpacesResponse(org.cloudfoundry.client.v2.spaces.ListSpacesResponse) Users(org.cloudfoundry.uaa.users.Users) RETURNS_SMART_NULLS(org.mockito.Mockito.RETURNS_SMART_NULLS) PackageType(org.cloudfoundry.client.v3.packages.PackageType) Pagination(org.cloudfoundry.client.v3.Pagination) PackageState(org.cloudfoundry.client.v3.packages.PackageState) Collections(java.util.Collections) Mockito.mock(org.mockito.Mockito.mock) Spaces(org.cloudfoundry.client.v2.spaces.Spaces) StepVerifier(reactor.test.StepVerifier) Test(org.junit.Test)

Example 3 with RETURNS_SMART_NULLS

use of org.mockito.Mockito.RETURNS_SMART_NULLS in project cf-java-client by cloudfoundry.

the class PaginationUtilsTest method requestUaaResourcesEmpty.

@Test
public void requestUaaResourcesEmpty() {
    Users users = mock(Users.class, RETURNS_SMART_NULLS);
    requestListUsersEmpty(users, 1, 100);
    PaginationUtils.requestUaaResources(startIndex -> users.list(ListUsersRequest.builder().startIndex(startIndex).build())).as(StepVerifier::create).expectComplete().verify(Duration.ofSeconds(1));
}
Also used : ListPackagesResponse(org.cloudfoundry.client.v3.packages.ListPackagesResponse) StepVerifier(reactor.test.StepVerifier) ListSpacesRequest(org.cloudfoundry.client.v2.spaces.ListSpacesRequest) TimeoutException(java.util.concurrent.TimeoutException) SpaceEntity(org.cloudfoundry.client.v2.spaces.SpaceEntity) BitsData(org.cloudfoundry.client.v3.packages.BitsData) ListUsersRequest(org.cloudfoundry.uaa.users.ListUsersRequest) Spaces(org.cloudfoundry.client.v2.spaces.Spaces) ListPackagesRequest(org.cloudfoundry.client.v3.packages.ListPackagesRequest) SpaceResource(org.cloudfoundry.client.v2.spaces.SpaceResource) PackageResource(org.cloudfoundry.client.v3.packages.PackageResource) Duration(java.time.Duration) User(org.cloudfoundry.uaa.users.User) Name(org.cloudfoundry.uaa.users.Name) Packages(org.cloudfoundry.client.v3.packages.Packages) ListUsersResponse(org.cloudfoundry.uaa.users.ListUsersResponse) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) Meta(org.cloudfoundry.uaa.users.Meta) Mockito.when(org.mockito.Mockito.when) ListSpacesResponse(org.cloudfoundry.client.v2.spaces.ListSpacesResponse) Users(org.cloudfoundry.uaa.users.Users) RETURNS_SMART_NULLS(org.mockito.Mockito.RETURNS_SMART_NULLS) PackageType(org.cloudfoundry.client.v3.packages.PackageType) Pagination(org.cloudfoundry.client.v3.Pagination) PackageState(org.cloudfoundry.client.v3.packages.PackageState) Collections(java.util.Collections) Mockito.mock(org.mockito.Mockito.mock) Users(org.cloudfoundry.uaa.users.Users) StepVerifier(reactor.test.StepVerifier) Test(org.junit.Test)

Aggregations

Duration (java.time.Duration)3 Collections (java.util.Collections)3 TimeoutException (java.util.concurrent.TimeoutException)3 ListSpacesRequest (org.cloudfoundry.client.v2.spaces.ListSpacesRequest)3 ListSpacesResponse (org.cloudfoundry.client.v2.spaces.ListSpacesResponse)3 SpaceEntity (org.cloudfoundry.client.v2.spaces.SpaceEntity)3 SpaceResource (org.cloudfoundry.client.v2.spaces.SpaceResource)3 Spaces (org.cloudfoundry.client.v2.spaces.Spaces)3 Pagination (org.cloudfoundry.client.v3.Pagination)3 BitsData (org.cloudfoundry.client.v3.packages.BitsData)3 ListPackagesRequest (org.cloudfoundry.client.v3.packages.ListPackagesRequest)3 ListPackagesResponse (org.cloudfoundry.client.v3.packages.ListPackagesResponse)3 PackageResource (org.cloudfoundry.client.v3.packages.PackageResource)3 PackageState (org.cloudfoundry.client.v3.packages.PackageState)3 PackageType (org.cloudfoundry.client.v3.packages.PackageType)3 Packages (org.cloudfoundry.client.v3.packages.Packages)3 ListUsersRequest (org.cloudfoundry.uaa.users.ListUsersRequest)3 ListUsersResponse (org.cloudfoundry.uaa.users.ListUsersResponse)3 Meta (org.cloudfoundry.uaa.users.Meta)3 Name (org.cloudfoundry.uaa.users.Name)3