|
1 | 1 | package org.typesense.api; |
2 | 2 |
|
3 | | -import junit.framework.TestCase; |
4 | | -import org.typesense.api.exceptions.TypesenseError; |
| 3 | +import org.junit.jupiter.api.AfterEach; |
| 4 | +import org.junit.jupiter.api.BeforeEach; |
| 5 | +import org.junit.jupiter.api.Test; |
5 | 6 | import org.typesense.model.CollectionAlias; |
6 | 7 | import org.typesense.model.CollectionAliasSchema; |
7 | 8 | import org.typesense.model.CollectionAliasesResponse; |
8 | | -import org.typesense.resources.Node; |
9 | 9 |
|
10 | | -import java.time.Duration; |
11 | | -import java.util.ArrayList; |
12 | | - |
13 | | -public class AliasesTest extends TestCase { |
| 10 | +class AliasesTest { |
14 | 11 |
|
15 | 12 | private Client client; |
16 | 13 | private Helper helper; |
17 | 14 |
|
18 | | - public void setUp() throws Exception { |
19 | | - super.setUp(); |
| 15 | + @BeforeEach |
| 16 | + void setUp() throws Exception { |
20 | 17 | helper = new Helper(); |
21 | 18 | helper.teardown(); |
22 | 19 | client = helper.getClient(); |
23 | 20 | helper.createTestAlias(); |
24 | 21 | } |
25 | 22 |
|
26 | | - public void tearDown() throws Exception { |
27 | | - super.tearDown(); |
| 23 | + @AfterEach |
| 24 | + void tearDown() throws Exception { |
28 | 25 | helper.teardown(); |
29 | 26 | } |
30 | 27 |
|
31 | | - public void testUpsert() throws Exception { |
| 28 | + @Test |
| 29 | + void testUpsert() throws Exception { |
32 | 30 | CollectionAliasSchema collectionAliasSchema = new CollectionAliasSchema(); |
33 | 31 | collectionAliasSchema.collectionName("books_june11"); |
34 | 32 |
|
35 | 33 | System.out.println(client.aliases().upsert("books1", collectionAliasSchema)); |
36 | 34 | } |
37 | 35 |
|
38 | | - public void testRetrieveAll() throws Exception { |
| 36 | + @Test |
| 37 | + void testRetrieveAll() throws Exception { |
39 | 38 | CollectionAliasesResponse collectionAliasesResponse = client.aliases().retrieve(); |
40 | 39 |
|
41 | 40 | System.out.println(collectionAliasesResponse); |
42 | 41 | } |
43 | 42 |
|
44 | | - public void testRetrieveSingleAlias() throws Exception { |
| 43 | + @Test |
| 44 | + void testRetrieveSingleAlias() throws Exception { |
45 | 45 | CollectionAlias collectionAlias = client.aliases("books").retrieve(); |
46 | 46 |
|
47 | 47 | System.out.println(collectionAlias); |
48 | 48 | } |
49 | 49 |
|
50 | | - public void testDelete() throws Exception { |
| 50 | + @Test |
| 51 | + void testDelete() throws Exception { |
51 | 52 | CollectionAlias collectionAlias = client.aliases("books").delete(); |
52 | 53 |
|
53 | 54 | System.out.println(collectionAlias); |
|
0 commit comments