diff --git a/README.md b/README.md index e560b26af4..3ec3f71f9a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # commercetools sync java [![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java) -[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.0-beta.3-beta.3/) +[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.0/) [![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646) @@ -60,26 +60,26 @@ Here are the most popular ones: com.commercetools commercetools-sync-java - 10.0.0-beta.3 + 10.0.0 ```` #### Gradle ````groovy -implementation 'com.commercetools:commercetools-sync-java:10.0.0-beta.3' +implementation 'com.commercetools:commercetools-sync-java:10.0.0' ```` #### SBT ```` -libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.0-beta.3" +libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.0" ```` #### Ivy ````xml - + ```` **Note**: To avoid `commercetools JVM SDK` libraries version mismatch between projects. diff --git a/docs/README.md b/docs/README.md index 4d22564def..bdb224c3d9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,9 +2,9 @@ # commercetools sync [![CI](https://github.com/commercetools/commercetools-sync-java/workflows/CI/badge.svg)](https://github.com/commercetools/commercetools-sync-java/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/commercetools/commercetools-sync-java/branch/master/graph/badge.svg)](https://codecov.io/gh/commercetools/commercetools-sync-java) -[![Benchmarks 10.0.0-beta.3](https://img.shields.io/badge/Benchmarks-10.0.0-beta.3-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/) -[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-10.0.0-beta.3-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.0-beta.3/jar) -[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.0-beta.3/) +[![Benchmarks 10.0.0](https://img.shields.io/badge/Benchmarks-10.0.0-orange.svg)](https://commercetools.github.io/commercetools-sync-java/benchmarks/) +[![Download from Maven Central](https://img.shields.io/badge/Maven_Central-10.0.0-blue.svg)](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.0/jar) +[![Javadoc](https://javadoc.io/badge2/com.commercetools/commercetools-sync-java/javadoc.svg?label=Javadoc)](https://commercetools.github.io/commercetools-sync-java/v/10.0.0/) [![Known Vulnerabilities](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646/badge.svg)](https://snyk.io/test/github/commercetools/commercetools-sync-java/4b2e26113d591bda158217c5dc1cf80a88665646) @@ -40,18 +40,18 @@ Here are the most popular ones: com.commercetools commercetools-sync-java - 10.0.0-beta.3 + 10.0.0 ```` #### Gradle ````groovy -implementation 'com.commercetools:commercetools-sync-java:10.0.0-beta.3' +implementation 'com.commercetools:commercetools-sync-java:10.0.0' ```` #### SBT ```` -libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.0-beta.3" +libraryDependencies += "com.commercetools" % "commercetools-sync-java" % "10.0.0" ```` #### Ivy ````xml - + ```` diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 9c297510a9..6880b61d05 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -27,14 +27,14 @@ 7. Add Migration guide section which specifies explicitly if there are breaking changes and how to tackle them. --> -### 10.0.0-beta.1 - Sep 8, 2023 -[Commits](https://github.com/commercetools/commercetools-sync-java/compare/9.2.3...10.0.0-beta.3) | -[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/10.0.0-beta.3/) | -[Jar](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.0-beta.3/jar) +### 10.0.0 - Nov 6, 2023 +[Commits](https://github.com/commercetools/commercetools-sync-java/compare/9.2.3...10.0.0) | +[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/10.0.0/) | +[Jar](https://search.maven.org/artifact/com.commercetools/commercetools-sync-java/10.0.0/jar) +- - 🚧 **Breaking Changes** (1) - commercetools-sync-java is now fully migrated to `commercetools-sdk-java-v2`. See [Migration Guide](./MIGRATION_GUIDE.md) on how to use this library version. - ### 9.2.3 - Mar 21, 2023 [Commits](https://github.com/commercetools/commercetools-sync-java/compare/9.2.1...9.2.3) | [Javadoc](https://commercetools.github.io/commercetools-sync-java/v/9.2.3/) | diff --git a/src/main/java/com/commercetools/sync/commons/helpers/BaseSyncStatistics.java b/src/main/java/com/commercetools/sync/commons/helpers/BaseSyncStatistics.java index 558232c20e..dd0fdc0806 100644 --- a/src/main/java/com/commercetools/sync/commons/helpers/BaseSyncStatistics.java +++ b/src/main/java/com/commercetools/sync/commons/helpers/BaseSyncStatistics.java @@ -2,6 +2,7 @@ import static java.lang.String.format; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.Nonnull; @@ -303,6 +304,44 @@ public String getSyncStatisticsClassName() { */ protected abstract SyncStatisticsT getThis(); + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + final BaseSyncStatistics that = (BaseSyncStatistics) o; + return latestBatchStartTime == that.latestBatchStartTime + && Objects.equals(getSyncStatisticsClassName(), that.getSyncStatisticsClassName()) + && getLatestBatchProcessingTimeInDays() == that.getLatestBatchProcessingTimeInDays() + && getLatestBatchProcessingTimeInHours() == that.getLatestBatchProcessingTimeInHours() + && getLatestBatchProcessingTimeInMinutes() == that.getLatestBatchProcessingTimeInMinutes() + && getLatestBatchProcessingTimeInSeconds() == that.getLatestBatchProcessingTimeInSeconds() + && getLatestBatchProcessingTimeInMillis() == that.getLatestBatchProcessingTimeInMillis() + && getUpdated().get() == that.getUpdated().get() + && getCreated().get() == that.getCreated().get() + && getFailed().get() == that.getFailed().get() + && getProcessed().get() == that.getProcessed().get() + && Objects.equals( + getLatestBatchHumanReadableProcessingTime(), + that.getLatestBatchHumanReadableProcessingTime()); + } + + @Override + public int hashCode() { + return Objects.hash( + getSyncStatisticsClassName(), + getUpdated().get(), + getCreated().get(), + getFailed().get(), + getProcessed().get(), + latestBatchStartTime, + getLatestBatchProcessingTimeInDays(), + getLatestBatchProcessingTimeInHours(), + getLatestBatchProcessingTimeInMinutes(), + getLatestBatchProcessingTimeInSeconds(), + getLatestBatchProcessingTimeInMillis(), + getLatestBatchHumanReadableProcessingTime()); + } + /** * Builds a proper summary message of the statistics report of a given {@code resourceString} in * following format: diff --git a/src/test/java/com/commercetools/sync/commons/helpers/BaseSyncStatisticsTest.java b/src/test/java/com/commercetools/sync/commons/helpers/BaseSyncStatisticsTest.java index 57a2d663a3..57bce8faf5 100644 --- a/src/test/java/com/commercetools/sync/commons/helpers/BaseSyncStatisticsTest.java +++ b/src/test/java/com/commercetools/sync/commons/helpers/BaseSyncStatisticsTest.java @@ -118,4 +118,12 @@ void getDefaultReportMessageForResource_withResourceString_ShouldBuildCorrectSum "Summary: 0 resources were processed in total (0 created, 0 updated and 0 " + "failed to sync)."); } + + @Test + void twoSyncsStatistics_withSameProperties_ShouldBeEqual() { + final CustomerSyncStatistics customerSyncStatistics = new CustomerSyncStatistics(); + final CustomerSyncStatistics customerSyncStatisticsIdentical = new CustomerSyncStatistics(); + + assertThat(customerSyncStatistics).isEqualTo(customerSyncStatisticsIdentical); + } }