use of com.vmware.flowgate.infobloxworker.model.InfoBloxIPInfoResult in project flowgate by vmware.
the class InfobloxClientTest method getExpectedResult.
private List<InfoBloxIPInfoResult> getExpectedResult() {
List<InfoBloxIPInfoResult> expectedResult = new ArrayList<>();
InfoBloxIPInfoResult infoBloxIPInfoResult1 = new InfoBloxIPInfoResult();
infoBloxIPInfoResult1.setIpAddress("10.161.71.154");
infoBloxIPInfoResult1.setHostName("ubuntu01");
infoBloxIPInfoResult1.setMacAddress("00:50:56:be:60:62");
expectedResult.add(infoBloxIPInfoResult1);
return expectedResult;
}
use of com.vmware.flowgate.infobloxworker.model.InfoBloxIPInfoResult in project flowgate by vmware.
the class InfobloxClientTest method queryHostRecordByIPTestZoneIsNull.
@Test
public void queryHostRecordByIPTestZoneIsNull() {
String ip = "10.161.71.154";
List<InfoBloxIPInfoResult> expectedResult = this.getExpectedResult();
InfobloxClient infobloxClient = new InfobloxClient(getInfobloxFacilitySoftware()[0]);
infobloxClient = Mockito.spy(infobloxClient);
Mockito.doReturn(this.getJsonResultForQueryHostRecordZoneIsNull()).when(infobloxClient).getHostRecord(ip);
List<InfoBloxIPInfoResult> actualResult = infobloxClient.queryHostRecordByIP(ip);
TestCase.assertEquals(expectedResult.size(), actualResult.size());
for (int i = 0; i < expectedResult.size(); i++) {
TestCase.assertEquals(expectedResult.get(i).getIpAddress(), actualResult.get(i).getIpAddress());
TestCase.assertEquals(expectedResult.get(i).getHostName(), actualResult.get(i).getHostName());
TestCase.assertEquals(expectedResult.get(i).getMacAddress(), actualResult.get(i).getMacAddress());
}
}
use of com.vmware.flowgate.infobloxworker.model.InfoBloxIPInfoResult in project flowgate by vmware.
the class InfobloxServiceTest method getInfoBloxIPInfoResults.
private List<InfoBloxIPInfoResult> getInfoBloxIPInfoResults() {
List<InfoBloxIPInfoResult> expectedResult = new ArrayList<>();
InfoBloxIPInfoResult infoBloxIPInfoResult1 = new InfoBloxIPInfoResult();
infoBloxIPInfoResult1.setIpAddress("10.161.71.154");
infoBloxIPInfoResult1.setHostName("ubuntu01");
infoBloxIPInfoResult1.setMacAddress("00:50:56:be:60:62");
expectedResult.add(infoBloxIPInfoResult1);
return expectedResult;
}
use of com.vmware.flowgate.infobloxworker.model.InfoBloxIPInfoResult in project flowgate by vmware.
the class InfobloxClientTest method queryHostRecordByIPTestZoneNonNull.
@Test
public void queryHostRecordByIPTestZoneNonNull() {
String ip = "10.161.71.154";
List<InfoBloxIPInfoResult> expectedResult = this.getExpectedResult();
InfobloxClient infobloxClient = new InfobloxClient(getInfobloxFacilitySoftware()[0]);
infobloxClient = Mockito.spy(infobloxClient);
Mockito.doReturn(this.getJsonResultForQueryHostRecordZoneNonNull()).when(infobloxClient).getHostRecord(ip);
List<InfoBloxIPInfoResult> actualResult = infobloxClient.queryHostRecordByIP(ip);
TestCase.assertEquals(expectedResult.size(), actualResult.size());
for (int i = 0; i < expectedResult.size(); i++) {
TestCase.assertEquals(expectedResult.get(i).getIpAddress(), actualResult.get(i).getIpAddress());
TestCase.assertEquals(expectedResult.get(i).getHostName(), actualResult.get(i).getHostName());
TestCase.assertEquals(expectedResult.get(i).getMacAddress(), actualResult.get(i).getMacAddress());
}
}
use of com.vmware.flowgate.infobloxworker.model.InfoBloxIPInfoResult in project flowgate by vmware.
the class InfobloxClientTest method queryHostNamesByIPTestZoneIsNull.
@Test
public void queryHostNamesByIPTestZoneIsNull() {
String ip = "10.161.71.154";
List<InfoBloxIPInfoResult> expectedResult = this.getExpectedResult();
InfobloxClient infobloxClient = new InfobloxClient(getInfobloxFacilitySoftware()[0]);
infobloxClient = Mockito.spy(infobloxClient);
Mockito.doReturn(this.getJsonResultForQueryHostNamesZoneIsNull()).when(infobloxClient).getIpv4address(ip);
List<InfoBloxIPInfoResult> actualResult = infobloxClient.queryIpv4addressByIP(ip);
TestCase.assertEquals(expectedResult.size(), actualResult.size());
for (int i = 0; i < expectedResult.size(); i++) {
TestCase.assertEquals(expectedResult.get(i).getIpAddress(), actualResult.get(i).getIpAddress());
TestCase.assertEquals(expectedResult.get(i).getHostName(), actualResult.get(i).getHostName());
TestCase.assertEquals(expectedResult.get(i).getMacAddress(), actualResult.get(i).getMacAddress());
}
}
Aggregations