Search in sources :

Example 1 with NoStorageException

use of org.zalando.nakadi.exceptions.runtime.NoStorageException in project nakadi by zalando.

the class StorageServiceTest method testDeleteNonExistingStorage.

@Test
public void testDeleteNonExistingStorage() throws Exception {
    doThrow(new NoStorageException("")).when(storageDbRepository).deleteStorage("s");
    final Result<Void> result = storageService.deleteStorage("s");
    final Result<Void> expectedResult = Result.notFound("No storage with ID s");
    assertThat(result.getProblem().getStatus(), equalTo(expectedResult.getProblem().getStatus()));
    assertThat(result.getProblem().getDetail(), equalTo(expectedResult.getProblem().getDetail()));
}
Also used : NoStorageException(org.zalando.nakadi.exceptions.runtime.NoStorageException) Test(org.junit.Test)

Aggregations

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