Refactored Unit tests based on rework

This commit is contained in:
2024-08-28 23:48:54 -04:00
parent e95547660e
commit b81bddb085

View File

@@ -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);