mirror of
https://github.com/Voronsky/unifi4j.git
synced 2025-12-12 08:16:33 -05:00
Refactored Unit tests based on rework
This commit is contained in:
@@ -13,32 +13,21 @@ public class UnifiTests {
|
||||
|
||||
@Test
|
||||
public void GetHostTest(){
|
||||
ResponseEntity<String> response;
|
||||
String response;
|
||||
System.out.println("UNIFI_KEY: "+System.getenv("UNIFI_KEY"));
|
||||
Unifi unifi = new Unifi("https://api.ui.com/ea", System.getenv("UNIFI_KEY"));
|
||||
response = unifi.getHosts();
|
||||
System.out.println("Status Code:" + response.getStatusCode());
|
||||
System.out.println("Content: "+response.getBody());
|
||||
|
||||
assert response.getStatusCode().is2xxSuccessful();
|
||||
assert !response.getBody().isEmpty();
|
||||
|
||||
try{
|
||||
JSONObject jsonObject = new JSONObject(response.getBody());
|
||||
System.out.println(jsonObject);
|
||||
} catch (JSONException err){
|
||||
System.out.println(err.toString());
|
||||
}
|
||||
System.out.println(response);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void GetHardwaresTest(){
|
||||
public void GetHardwareListTest(){
|
||||
List<String> response = new ArrayList<>();
|
||||
System.out.println("UNIFI_KEY: "+System.getenv("UNIFI_KEY"));
|
||||
Unifi unifi = new Unifi("https://api.ui.com/ea", System.getenv("UNIFI_KEY"));
|
||||
try {
|
||||
response = unifi.getHardware();
|
||||
response = unifi.getHardwareList();
|
||||
}
|
||||
catch(Exception e){
|
||||
System.out.println("Exception: "+e);
|
||||
|
||||
Reference in New Issue
Block a user