Search in sources :

Example 1 with IndividualSpaceAllocation

use of com.dropbox.core.v2.users.IndividualSpaceAllocation in project PrettySecureCloud by SandroGuerotto.

the class DropBoxServiceTest method getAvailableStorageSpace.

@Test
void getAvailableStorageSpace() throws DbxException {
    cut = new DropBoxService(dbxClientV2Mock);
    DbxUserUsersRequests DbxUserUsersRequestsMock = mock(DbxUserUsersRequests.class);
    when(dbxClientV2Mock.users()).thenReturn(DbxUserUsersRequestsMock);
    when(DbxUserUsersRequestsMock.getSpaceUsage()).thenReturn(new SpaceUsage(1_000_000_000_000L, SpaceAllocation.individual(new IndividualSpaceAllocation(5_000_000_000_000L))));
    BigDecimal usedStorageSpace = cut.getUsedStorageSpace();
    assertEquals(1_000_000_000_000L, usedStorageSpace.longValue());
}
Also used : SpaceUsage(com.dropbox.core.v2.users.SpaceUsage) DbxUserUsersRequests(com.dropbox.core.v2.users.DbxUserUsersRequests) IndividualSpaceAllocation(com.dropbox.core.v2.users.IndividualSpaceAllocation) BigDecimal(java.math.BigDecimal) Test(org.junit.jupiter.api.Test)

Aggregations

DbxUserUsersRequests (com.dropbox.core.v2.users.DbxUserUsersRequests)1 IndividualSpaceAllocation (com.dropbox.core.v2.users.IndividualSpaceAllocation)1 SpaceUsage (com.dropbox.core.v2.users.SpaceUsage)1 BigDecimal (java.math.BigDecimal)1 Test (org.junit.jupiter.api.Test)1