@Test public void testNullVersion() { assertEquals(IntegrationBridgeServiceInfo.Compability.UNKNOWN, new IntegrationBridgeServiceInfo(null, SERVICE_URL).getCompatibility()); assertEquals(IntegrationBridgeServiceInfo.Compability.NOK, new IntegrationBridgeServiceInfo(NEW_VERSION, SERVICE_URL).getCompatibility()); }
public Compability getCompatibility() { if (StringUtils.isEmpty(minVersion)) { return Compability.UNKNOWN; } if (StringUtils.isEmpty(currentVersion)) { return Compability.NOK; } try { Version minServiceVersion = Version.valueOf(minVersion); Version currentServiceVersion = Version.valueOf(currentVersion); if (currentServiceVersion.greaterThanOrEqualTo(minServiceVersion)) { return Compability.OK; } else { return Compability.NOK; } } catch (ParseException e) { return Compability.NOK; } }
IntegrationBridgeServiceInfo { public Compability getCompatibility() { if (StringUtils.isEmpty(minVersion)) { return Compability.UNKNOWN; } if (StringUtils.isEmpty(currentVersion)) { return Compability.NOK; } try { Version minServiceVersion = Version.valueOf(minVersion); Version currentServiceVersion = Version.valueOf(currentVersion); if (currentServiceVersion.greaterThanOrEqualTo(minServiceVersion)) { return Compability.OK; } else { return Compability.NOK; } } catch (ParseException e) { return Compability.NOK; } } }
IntegrationBridgeServiceInfo { public Compability getCompatibility() { if (StringUtils.isEmpty(minVersion)) { return Compability.UNKNOWN; } if (StringUtils.isEmpty(currentVersion)) { return Compability.NOK; } try { Version minServiceVersion = Version.valueOf(minVersion); Version currentServiceVersion = Version.valueOf(currentVersion); if (currentServiceVersion.greaterThanOrEqualTo(minServiceVersion)) { return Compability.OK; } else { return Compability.NOK; } } catch (ParseException e) { return Compability.NOK; } } IntegrationBridgeServiceInfo(String minVersion, String url); }
IntegrationBridgeServiceInfo { public Compability getCompatibility() { if (StringUtils.isEmpty(minVersion)) { return Compability.UNKNOWN; } if (StringUtils.isEmpty(currentVersion)) { return Compability.NOK; } try { Version minServiceVersion = Version.valueOf(minVersion); Version currentServiceVersion = Version.valueOf(currentVersion); if (currentServiceVersion.greaterThanOrEqualTo(minServiceVersion)) { return Compability.OK; } else { return Compability.NOK; } } catch (ParseException e) { return Compability.NOK; } } IntegrationBridgeServiceInfo(String minVersion, String url); String getConnectivity(); void setConnectivity(Status connectivity); String getCurrentVersion(); void setCurrentVersion(String currentVersion); String getMinVersion(); Compability getCompatibility(); String getUrl(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
IntegrationBridgeServiceInfo { public Compability getCompatibility() { if (StringUtils.isEmpty(minVersion)) { return Compability.UNKNOWN; } if (StringUtils.isEmpty(currentVersion)) { return Compability.NOK; } try { Version minServiceVersion = Version.valueOf(minVersion); Version currentServiceVersion = Version.valueOf(currentVersion); if (currentServiceVersion.greaterThanOrEqualTo(minServiceVersion)) { return Compability.OK; } else { return Compability.NOK; } } catch (ParseException e) { return Compability.NOK; } } IntegrationBridgeServiceInfo(String minVersion, String url); String getConnectivity(); void setConnectivity(Status connectivity); String getCurrentVersion(); void setCurrentVersion(String currentVersion); String getMinVersion(); Compability getCompatibility(); String getUrl(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }