use of org.zalando.nakadi.exceptions.runtime.StorageIsUsedException in project nakadi by zalando.
the class StorageServiceTest method testDeleteStorageInUse.
@Test
public void testDeleteStorageInUse() throws Exception {
doThrow(new StorageIsUsedException("", null)).when(storageDbRepository).deleteStorage("s");
final Result<Void> result = storageService.deleteStorage("s");
final Result<Void> expectedResult = Result.forbidden("Storage s is in use");
assertThat(result.getProblem().getStatus(), equalTo(expectedResult.getProblem().getStatus()));
assertThat(result.getProblem().getDetail(), equalTo(expectedResult.getProblem().getDetail()));
}
Aggregations