| | |
| | | import java.util.SortedSet; |
| | | import java.util.concurrent.Callable; |
| | | |
| | | import org.assertj.core.api.SoftAssertions; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ModificationType; |
| | |
| | | } |
| | | |
| | | private InternalSearchOperation searchChangelog(final SearchRequest request, final int expectedNbEntries, |
| | | ResultCode expectedResultCode, String testName) throws Exception |
| | | final ResultCode expectedResultCode, String testName) throws Exception |
| | | { |
| | | TestTimer timer = new TestTimer.Builder() |
| | | .maxSleep(5, SECONDS) |
| | |
| | | public InternalSearchOperation call() throws Exception |
| | | { |
| | | InternalSearchOperation searchOp = connection.processSearch(request); |
| | | assertThat(searchOp.getSearchEntries()).hasSize(expectedNbEntries); |
| | | |
| | | final SoftAssertions softly = new SoftAssertions(); |
| | | softly.assertThat(searchOp.getResultCode()).as(searchOp.getErrorMessage().toString()) |
| | | .isEqualTo(expectedResultCode); |
| | | softly.assertThat(searchOp.getSearchEntries()).hasSize(expectedNbEntries); |
| | | softly.assertAll(); |
| | | |
| | | return searchOp; |
| | | } |
| | | }); |
| | | |
| | | final List<SearchResultEntry> entries = searchOp.getSearchEntries(); |
| | | assertThat(entries).hasSize(expectedNbEntries); |
| | | debugAndWriteEntries(getLDIFWriter(), entries, testName); |
| | | waitForSearchOpResult(searchOp, expectedResultCode); |
| | | debugAndWriteEntries(getLDIFWriter(), searchOp.getSearchEntries(), testName); |
| | | return searchOp; |
| | | } |
| | | |