use of com.nike.cerberus.domain.SDBMetadata in project cerberus by Nike-Inc.
the class AdminActionsControllerTest method testOverrideOwner.
@Test
public void testOverrideOwner() {
SDBMetadata sdbMetadata = Mockito.mock(SDBMetadata.class);
Authentication authentication = Mockito.mock(Authentication.class);
Mockito.when(sdbMetadata.getName()).thenReturn("name");
Mockito.when(sdbMetadata.getOwner()).thenReturn("owner");
Mockito.when(authentication.getName()).thenReturn("name");
adminActionsController.overrideSdbOwner(sdbMetadata, authentication);
Mockito.verify(safeDepositBoxService).overrideOwner("name", "owner", "name");
}
use of com.nike.cerberus.domain.SDBMetadata in project cerberus by Nike-Inc.
the class SdbMetadataControllerTest method testRestoreSdbIncludingDataInRequest.
@Test
public void testRestoreSdbIncludingDataInRequest() {
SDBMetadata sdbMetadata = Mockito.mock(SDBMetadata.class);
Authentication authentication = Mockito.mock(Authentication.class);
Mockito.when(authentication.getName()).thenReturn("name");
Mockito.when(sdbMetadata.getPath()).thenReturn("path");
Mockito.when(safeDepositBoxService.getSafeDepositBoxIdByPath("path")).thenReturn(Optional.of("id"));
sdbMetadataController.restoreSdbIncludingDataInRequest(sdbMetadata, authentication);
Mockito.verify(safeDepositBoxService).deleteSafeDepositBox("id");
Mockito.verify(metadataService).restoreMetadata(sdbMetadata, "name");
}
Aggregations