View Javadoc
1   /*
2    * SPDX-FileCopyrightText: Copyright (c) 2012-2026 Yegor Bugayenko
3    * SPDX-License-Identifier: MIT
4    */
5   package com.jcabi.dynamo.retry;
6   
7   import com.jcabi.dynamo.Attributes;
8   import com.jcabi.dynamo.Table;
9   import java.io.IOException;
10  import org.junit.jupiter.api.Assertions;
11  import org.junit.jupiter.api.Test;
12  import org.mockito.Mockito;
13  
14  /**
15   * Test case for {@link ReTable}.
16   * @since 0.1
17   */
18  final class ReTableTest {
19  
20      @Test
21      void retriesDeleteOnFailure() throws Exception {
22          final Table table = Mockito.mock(Table.class);
23          Mockito.doThrow(new IOException("Exception!")).when(table)
24              .delete(new Attributes());
25          final Table retried = new ReTable(table);
26          Assertions.assertThrows(
27              IOException.class,
28              () -> retried.delete(new Attributes())
29          );
30      }
31  }