use of com.hp.octane.integrations.dto.general.CIProviderSummaryInfo in project octane-ci-java-sdk by MicroFocus.
the class StatusInfoTest method testA.
@Test
public void testA() {
CIProviderSummaryInfo statusInfo = dtoFactory.newDTO(CIProviderSummaryInfo.class);
CIPluginInfo CIPluginInfo = dtoFactory.newDTO(CIPluginInfo.class).setVersion(PLUGIN_VERSION);
CIServerInfo CIServerInfo = dtoFactory.newDTO(CIServerInfo.class).setType(CIServerTypes.JENKINS.value()).setVersion(SERVER_VERION).setInstanceId(SERVER_UUID).setInstanceIdFrom(SERVER_UUID_FROM).setSendingTime(SYNC_TIME).setUrl(INPUT_SERVER_URL);
statusInfo.setPlugin(CIPluginInfo);
statusInfo.setServer(CIServerInfo);
String json = dtoFactory.dtoToJson(statusInfo);
CIProviderSummaryInfo newStatus = dtoFactory.dtoFromJson(json, CIProviderSummaryInfo.class);
assertNotNull(newStatus);
assertNotNull(newStatus.getPlugin());
assertEquals(PLUGIN_VERSION, newStatus.getPlugin().getVersion());
assertNotNull(newStatus.getServer());
assertEquals(CIServerTypes.JENKINS.value(), newStatus.getServer().getType());
assertEquals(SERVER_VERION, newStatus.getServer().getVersion());
assertEquals(SERVER_UUID, newStatus.getServer().getInstanceId());
assertEquals(SERVER_UUID_FROM, newStatus.getServer().getInstanceIdFrom());
assertEquals(SYNC_TIME, newStatus.getServer().getSendingTime());
assertEquals(EXPECTED_SERVER_URL, newStatus.getServer().getUrl());
}
Aggregations