Skip to content

Commit

Permalink
Periodic dependencies bump ()
Browse files Browse the repository at this point in the history
aws-java-sdk 1.12.377 -> 1.12.399
lucene 9.4.2 -> 9.5.0
mockito 4.11.0 -> 5.1.1
jackson 2.14.1 -> 2.14.2
jackson-databind 2.14.1 -> 2.14.2
picocli 4.7.0 -> 4.7.1
restrict-imports-enforcer-rule 2.0.0 -> 2.1.0
jna 5.12.1 -> 5.13.0
jose4j 0.7.12 -> 0.9.2
reactor-bom 2022.0.1 -> 2022.0.2
assertj-core 3.23.1 -> 3.24.2

Mockito changed a way again how they work with final methods/classes and varargs so some adaptations where made to tests. See mockito/mockito#2802 for details.
  • Loading branch information
MishaDemianenko committed Feb 8, 2023
1 parent 9a7a206 commit 16aa710
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 53 deletions.
Expand Up @@ -84,7 +84,7 @@ private PrintWriter writer() {
}

public final MultiPartBuilder multipleParts(String process) {
return new MultiPartBuilder(this, process);
return new MultiPartBuilder(newIndicator(process));
}

public final ProgressListener singlePart(String process, long totalCount) {
Expand All @@ -97,8 +97,8 @@ public static class MultiPartBuilder {
private Aggregator aggregator;
private Set<String> parts = new HashSet<>();

private MultiPartBuilder(ProgressMonitorFactory factory, String process) {
this.aggregator = new Aggregator(factory.newIndicator(process));
private MultiPartBuilder(Indicator indicator) {
this.aggregator = new Aggregator(indicator);
}

public ProgressListener progressForPart(String part, long totalCount) {
Expand All @@ -110,14 +110,6 @@ public ProgressListener progressForPart(String part, long totalCount) {
return progress;
}

public ProgressListener progressForUnknownPart(String part) {
assertNotBuilt();
assertUniquePart(part);
ProgressListener progress = ProgressListener.NONE;
aggregator.add(progress, 0);
return progress;
}

private void assertUniquePart(String part) {
if (!parts.add(part)) {
throw new IllegalArgumentException(String.format("Part '%s' has already been defined.", part));
Expand All @@ -132,7 +124,7 @@ private void assertNotBuilt() {

/**
* Have to be called after all individual progresses have been added.
* @return a {@link Completer} which can be called do issue {@link ProgressListener#done()} for all individual progress parts.
* @return a {@link Completer} which can be called do issue {@link ProgressListener#close()} for all individual progress parts.
*/
public Completer build() {
Preconditions.checkState(aggregator != null, "Already built");
Expand All @@ -143,7 +135,7 @@ public Completer build() {
}

/**
* Can be called to invoke all individual {@link ProgressListener#done()}.
* Can be called to invoke all individual {@link ProgressListener#close()}.
*/
public void done() {
aggregator.done();
Expand Down
2 changes: 1 addition & 1 deletion community/community-it/it-test-support/LICENSES.txt
Expand Up @@ -29,7 +29,7 @@ Apache Software License, Version 2.0
Apache Shiro :: Cryptography :: Hashing
Apache Shiro :: Event
Apache Shiro :: Lang
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Caffeine cache
Expand Down
2 changes: 1 addition & 1 deletion community/community-it/it-test-support/NOTICE.txt
Expand Up @@ -51,7 +51,7 @@ Apache Software License, Version 2.0
Apache Shiro :: Cryptography :: Hashing
Apache Shiro :: Event
Apache Shiro :: Lang
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Caffeine cache
Expand Down
Expand Up @@ -249,9 +249,9 @@ void shouldLockNodesWhileReadingThem() {
assertNotNull(lock1, "Lock[node=1] never acquired");
InOrder order = inOrder(locks, lock0, lock1);
order.verify(locks).acquireNodeLock(0, SHARED);
order.verify(lock0).release();
order.verify(lock0).close();
order.verify(locks).acquireNodeLock(1, SHARED);
order.verify(lock1).release();
order.verify(lock1).close();
}

@Test
Expand Down Expand Up @@ -280,9 +280,9 @@ void shouldLockRelationshipsWhileReadingThem() {
assertNotNull(lock1, "Lock[relationship=" + sKnowsA.getId() + "] never acquired");
InOrder order = inOrder(locks, lock0, lock1);
order.verify(locks).acquireRelationshipLock(aKnowsS.getId(), SHARED);
order.verify(lock0).release();
order.verify(lock0).close();
order.verify(locks).acquireRelationshipLock(sKnowsA.getId(), SHARED);
order.verify(lock1).release();
order.verify(lock1).close();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion community/kernel-test-utils/LICENSES.txt
Expand Up @@ -13,7 +13,7 @@ Apache Software License, Version 2.0
Apache Lucene (module: common)
Apache Lucene (module: core)
Apache Lucene (module: queryparser)
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Caffeine cache
Expand Down
2 changes: 1 addition & 1 deletion community/kernel-test-utils/NOTICE.txt
Expand Up @@ -35,7 +35,7 @@ Apache Software License, Version 2.0
Apache Lucene (module: common)
Apache Lucene (module: core)
Apache Lucene (module: queryparser)
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Caffeine cache
Expand Down
Expand Up @@ -24,7 +24,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.inOrder;
Expand Down Expand Up @@ -53,8 +52,12 @@ class ProgressMonitorTest {
void setUp() {
indicator = indicatorMock();
when(indicator.reportResolution()).thenReturn(10);
factory = mock(ProgressMonitorFactory.class);
when(factory.newIndicator(any(String.class))).thenReturn(indicator);
factory = new ProgressMonitorFactory() {
@Override
protected Indicator newIndicator(String process) {
return indicator;
}
};
}

@Test
Expand Down Expand Up @@ -128,8 +131,7 @@ void shouldNotAllowAddingPartsAfterCompletingMultiPartBuilder(TestInfo testInfo)

@Test
void shouldNotAllowAddingMultiplePartsWithSameIdentifier(TestInfo testInfo) {
ProgressMonitorFactory.MultiPartBuilder builder =
mock(ProgressMonitorFactory.class).multipleParts(testInfo.getDisplayName());
ProgressMonitorFactory.MultiPartBuilder builder = factory.multipleParts(testInfo.getDisplayName());
builder.progressForPart("first", 10);

IllegalArgumentException exception =
Expand Down
Expand Up @@ -340,7 +340,7 @@ void shouldWaitForAvailabilityWhenShutdown() throws Exception {
}

private static void verifyLogging(InternalLog log, VerificationMode mode) {
verify(log, mode).info(anyString(), Mockito.<Object[]>any());
verify(log, mode).info(anyString(), Mockito.any(Object[].class));
}

private DatabaseAvailabilityGuard getDatabaseAvailabilityGuard(Clock clock, InternalLog log) {
Expand Down
Expand Up @@ -97,7 +97,7 @@ void shouldThrowOnIndexEntryConflict() throws Exception {
ValueIndexReader reader = mock(ValueIndexReader.class);
doAnswer(new NodeIdsIndexReaderQueryAnswer(descriptor, 101, 202))
.when(reader)
.query(any(), any(), any(), any(), any());
.query(any(), any(), any(), any(), any(PropertyIndexQuery[].class));
DeferredConflictCheckingIndexUpdater updater =
new DeferredConflictCheckingIndexUpdater(actual, () -> reader, descriptor, NULL_CONTEXT);

Expand Down
Expand Up @@ -27,11 +27,13 @@
import java.util.function.Function;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.ByteVectorValues;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FloatVectorValues;
import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
Expand All @@ -41,10 +43,11 @@
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.StoredFieldVisitor;
import org.apache.lucene.index.StoredFields;
import org.apache.lucene.index.TermVectors;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.VectorEncoding;
import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.index.VectorValues;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.util.Bits;
import org.neo4j.internal.helpers.collection.MapUtil;
Expand Down Expand Up @@ -132,7 +135,12 @@ public NumericDocValues getNormValues(String field) {
}

@Override
public VectorValues getVectorValues(String field) {
public FloatVectorValues getFloatVectorValues(String s) {
throw new UnsupportedOperationException();
}

@Override
public ByteVectorValues getByteVectorValues(String s) {
throw new UnsupportedOperationException();
}

Expand All @@ -141,6 +149,11 @@ public TopDocs searchNearestVectors(String field, float[] target, int k, Bits ac
return null;
}

@Override
public TopDocs searchNearestVectors(String s, byte[] bytes, int i, Bits bits, int i1) {
throw new UnsupportedOperationException();
}

@Override
public FieldInfos getFieldInfos() {
List<FieldInfo> infos = new ArrayList<>();
Expand Down Expand Up @@ -203,6 +216,11 @@ public Fields getTermVectors(int docID) {
throw new RuntimeException("Not yet implemented.");
}

@Override
public TermVectors termVectors() {
throw new UnsupportedOperationException();
}

@Override
public int numDocs() {
return elements.length;
Expand All @@ -218,6 +236,11 @@ public void document(int docID, StoredFieldVisitor visitor) throws IOException {
visitor.stringField(DUMMY_FIELD_INFO, String.valueOf(docID));
}

@Override
public StoredFields storedFields() {
throw new UnsupportedOperationException();
}

@Override
protected void doClose() {}

Expand Down
Expand Up @@ -22,6 +22,7 @@
import static java.lang.String.format;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.atMostOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
Expand Down Expand Up @@ -102,12 +103,25 @@ void shouldLogInconsistency(ReportMethods methods) throws Exception {

// then
if (method.getAnnotation(Warning.class) == null) {
verify(report)
.error(any(RecordType.class), any(AbstractBaseRecord.class), argThat(expectedFormat()), any());
var verificationMode = atMostOnce();
verify(report, verificationMode)
.error(
any(RecordType.class),
any(AbstractBaseRecord.class),
argThat(expectedFormat()),
any(Object[].class));
verify(report, verificationMode)
.error(any(RecordType.class), any(AbstractBaseRecord.class), argThat(expectedFormat()));
} else {
verify(report)
var verificationMode = atMostOnce();
verify(report, verificationMode)
.warning(
any(RecordType.class), any(AbstractBaseRecord.class), argThat(expectedFormat()), any());
any(RecordType.class),
any(AbstractBaseRecord.class),
argThat(expectedFormat()),
any(Object[].class));
verify(report, verificationMode)
.warning(any(RecordType.class), any(AbstractBaseRecord.class), argThat(expectedFormat()));
}
}

Expand Down
Expand Up @@ -85,7 +85,8 @@ void shouldHandleCircularPropertyChain() {
chunk.visitPropertyChainNoThrow(visitor, primitiveRecord, EntityType.NODE, new String[0]);

// then
verify(readBehaviour).error(argThat(format -> format.contains("circular property chain")), any());
verify(readBehaviour)
.error(argThat(format -> format.contains("circular property chain")), any(Object[].class));
}
}

Expand Down Expand Up @@ -145,7 +146,8 @@ void breakOnBrokenPropertyChain() {
chunk.visitPropertyChainNoThrow(visitor, nodeRecord, EntityType.NODE, new String[0]);

// then
verify(readBehaviour).error(argThat(format -> format.contains("Ignoring broken property chain.")), any());
verify(readBehaviour)
.error(argThat(format -> format.contains("Ignoring broken property chain.")), any(Object[].class));
}
}

Expand Down
2 changes: 1 addition & 1 deletion community/server-test-utils/LICENSES.txt
Expand Up @@ -29,7 +29,7 @@ Apache Software License, Version 2.0
Apache Shiro :: Cryptography :: Hashing
Apache Shiro :: Event
Apache Shiro :: Lang
AssertJ fluent assertions
AssertJ Core
Caffeine cache
fastinfoset
IPAddress
Expand Down
2 changes: 1 addition & 1 deletion community/server-test-utils/NOTICE.txt
Expand Up @@ -51,7 +51,7 @@ Apache Software License, Version 2.0
Apache Shiro :: Cryptography :: Hashing
Apache Shiro :: Event
Apache Shiro :: Lang
AssertJ fluent assertions
AssertJ Core
Caffeine cache
fastinfoset
IPAddress
Expand Down
2 changes: 1 addition & 1 deletion community/testing/log-utils/LICENSES.txt
Expand Up @@ -9,7 +9,7 @@ Apache Software License, Version 2.0
Apache Log4j API
Apache Log4j Core
Apache Log4j Layout for JSON template
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Jackson-annotations
Expand Down
2 changes: 1 addition & 1 deletion community/testing/log-utils/NOTICE.txt
Expand Up @@ -31,7 +31,7 @@ Apache Software License, Version 2.0
Apache Log4j API
Apache Log4j Core
Apache Log4j Layout for JSON template
AssertJ fluent assertions
AssertJ Core
Byte Buddy (without dependencies)
Byte Buddy agent
Jackson-annotations
Expand Down
2 changes: 1 addition & 1 deletion community/testing/test-utils/LICENSES.txt
Expand Up @@ -5,7 +5,7 @@ libraries. For an overview of the licenses see the NOTICE.txt file.
------------------------------------------------------------------------------
Apache Software License, Version 2.0
Apache Commons Lang
AssertJ fluent assertions
AssertJ Core
Awaitility
Byte Buddy (without dependencies)
Byte Buddy agent
Expand Down
2 changes: 1 addition & 1 deletion community/testing/test-utils/NOTICE.txt
Expand Up @@ -27,7 +27,7 @@ Third-party licenses

Apache Software License, Version 2.0
Apache Commons Lang
AssertJ fluent assertions
AssertJ Core
Awaitility
Byte Buddy (without dependencies)
Byte Buddy agent
Expand Down

0 comments on commit 16aa710

Please sign in to comment.