startOffsetsUpdating = new HashMap<>();
+ TopicPartition tpDeleting = new TopicPartition(TOPIC_MEMBER_CATEGORY_DELETE, PARTITION);
+ startOffsetsUpdating.put(tpDeleting, 0L);
+ mockConsumer.updateBeginningOffsets(startOffsetsUpdating);
+
+ //ASSERT
+ Thread.sleep(10000);
+ ClearingMemberCategory resultUpdating = iMap.get(currentId);
+ Assertions.assertEquals(0, iMap.size());
+
+ //preparing hazelcastImdgProvider for next test
+ iMap.clear();
+ currentId++;
+ }
+}
\ No newline at end of file
diff --git a/clearing-parent/company-service/src/test/java/ru/spcex/clearing/company/utils/MatcherFactory.java b/clearing-parent/company-service/src/test/java/ru/spcex/clearing/company/utils/MatcherFactory.java
new file mode 100644
index 000000000..e850b89ef
--- /dev/null
+++ b/clearing-parent/company-service/src/test/java/ru/spcex/clearing/company/utils/MatcherFactory.java
@@ -0,0 +1,38 @@
+package ru.spcex.clearing.company.utils;
+
+import java.util.Arrays;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Factory for creating test matchers.
+ *
+ * Comparing actual and expected objects via AssertJ
+ */
+public class MatcherFactory {
+
+ public static Matcher usingIgnoringFieldsComparator(String... fieldsToIgnore) {
+ return new Matcher<>(fieldsToIgnore);
+ }
+
+ public static class Matcher {
+ private final String[] fieldsToIgnore;
+
+ private Matcher(String... fieldsToIgnore) {
+ this.fieldsToIgnore = fieldsToIgnore;
+ }
+
+ public void assertMatch(T actual, T expected) {
+ assertThat(actual).usingRecursiveComparison().ignoringFields(fieldsToIgnore).isEqualTo(expected);
+ }
+
+ @SafeVarargs
+ public final void assertMatch(Iterable actual, T... expected) {
+ assertMatch(actual, Arrays.asList(expected));
+ }
+
+ public void assertMatch(Iterable actual, Iterable expected) {
+ assertThat(actual).usingRecursiveFieldByFieldElementComparatorIgnoringFields(fieldsToIgnore).isEqualTo(expected);
+ }
+ }
+}