Skip to content

Commit 415acbd

Browse files
emilienbevCopilot
andauthored
Get method by name
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Emilien Bevierre <44171454+emilienbev@users.noreply.github.com>
1 parent 58eef8c commit 415acbd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/test/java/org/springframework/data/couchbase/repository/query/SearchScanConsistencyTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ void searchScanConsistencyDefaultsToNotBoundedWhenAnnotatedWithoutSearchAttribut
7373
}
7474

7575
@Test
76-
void searchScanConsistencyAnnotationValueAttribute() {
76+
void searchScanConsistencyAnnotationValueAttribute() throws NoSuchMethodException {
7777
// Verify the search attribute exists on the ScanConsistency annotation
78-
ScanConsistency annotation = TestScanConsistencyRepository.class.getMethods()[0].getAnnotation(ScanConsistency.class);
78+
ScanConsistency annotation = TestScanConsistencyRepository.class.getMethod("searchWithConsistency")
79+
.getAnnotation(ScanConsistency.class);
7980
// Just verify the annotation type has the search() attribute
8081
assertDoesNotThrow(() -> ScanConsistency.class.getMethod("search"));
8182
}

0 commit comments

Comments
 (0)