Skip to content

Commit 4ad9672

Browse files
committed
add: test for health and operations endpoint
1 parent 6cc35d6 commit 4ad9672

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.typesense.api;
2+
3+
import junit.framework.TestCase;
4+
import org.typesense.resources.Node;
5+
6+
import java.time.Duration;
7+
import java.util.ArrayList;
8+
import java.util.HashMap;
9+
10+
public class HealthAndOperationsTest extends TestCase {
11+
12+
private Client client;
13+
private Helper helper;
14+
15+
public void setUp() throws Exception {
16+
super.setUp();
17+
helper = new Helper();
18+
client = helper.getClient();
19+
}
20+
21+
public void tearDown() throws Exception {
22+
super.tearDown();
23+
helper.teardown();
24+
}
25+
26+
public void testRetrieve() {
27+
System.out.println(this.client.health.retrieve());
28+
}
29+
30+
public void testPerformSnapshot(){
31+
HashMap<String, String> query = new HashMap<>();
32+
query.put("snapshot_path","/tmp/typesense-data-snapshot");
33+
System.out.println(client.operations.perform("snapshot",query));
34+
}
35+
36+
public void testPerformVote(){
37+
System.out.println(client.operations.perform("vote"));
38+
}
39+
40+
public void testMetrics(){
41+
System.out.println(client.metrics.retrieve());
42+
}
43+
44+
public void testDebug(){
45+
System.out.println(client.debug.retrieve());
46+
}
47+
}

0 commit comments

Comments
 (0)