Search in sources :

Example 1 with StorageIsUsedException

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()));
}
Also used : StorageIsUsedException(org.zalando.nakadi.exceptions.runtime.StorageIsUsedException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StorageIsUsedException (org.zalando.nakadi.exceptions.runtime.StorageIsUsedException)1