This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 6b496bad2c67 CAMEL-27084: camel-jira - a failed search for the latest
issue at startup no longer routes the existing issues as new ones (#30311)
6b496bad2c67 is described below
commit 6b496bad2c67997e57cce2dc5f2fa639fb02aabd
Author: allthingssecurity <[email protected]>
AuthorDate: Wed Nov 18 17:50:35 2026 +0530
CAMEL-27084: camel-jira - a failed search for the latest issue at startup
no longer routes the existing issues as new ones (#30311)
At startup the newIssues consumer searches for the latest issue of the JQL,
so
that it routes only the issues created after it started. findLatestIssue
caught every exception of that search and returned null, as for a JQL that
matches no issue. When the search failed (a 429 or 5xx answer, a timeout),
the
first poll ran the plain JQL and routed the first page of the issues that
already existed as new issues.
A failed lookup at startup is now logged at WARN and done again at the next
poll, before any issue is routed; a failure then fails that poll. A JQL that
matches no issue still starts without a latest issue, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.../component/jira/consumer/NewIssuesConsumer.java | 83 +++++++---
.../NewIssuesConsumerCreatedSinceStartTest.java | 169 +++++++++++++++++++++
.../NewIssuesConsumerStartupLookupFailsTest.java | 149 ++++++++++++++++++
3 files changed, 381 insertions(+), 20 deletions(-)
diff --git
a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
index b091f1b43e1a..e847e92b0d6e 100644
---
a/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
+++
b/components/camel-jira/src/main/java/org/apache/camel/component/jira/consumer/NewIssuesConsumer.java
@@ -24,6 +24,7 @@ import com.atlassian.jira.rest.client.api.domain.User;
import org.apache.camel.Processor;
import org.apache.camel.component.jira.JiraEndpoint;
import org.apache.camel.util.CastUtils;
+import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
@@ -42,6 +43,12 @@ import org.slf4j.LoggerFactory;
* <p>
* NOTE: We manually add "ORDER BY created DESC" to the JQL in order to
optimize startup (the latest issues one at a
* time) and to correctly get the newest issue.
+ * <p>
+ * If the search for the latest issue fails at startup, the polls ask for the
issues created since the consumer started
+ * instead, until one is found: the JQL asks for the minute of the start, and
only the issues whose creation date is
+ * after the start are kept. That start is read from the local clock and
compared with the creation dates of the server,
+ * so while the lookup has failed, a clock skew between the two (usually
seconds with NTP) can route an issue created
+ * just before the start, or miss one created just after it.
*/
public class NewIssuesConsumer extends AbstractJiraConsumer {
private static final Logger LOG =
LoggerFactory.getLogger(NewIssuesConsumer.class);
@@ -52,6 +59,11 @@ public class NewIssuesConsumer extends AbstractJiraConsumer {
// Last issue that was processed by the integration
private Issue latestIssue;
+ // Whether the latest issue was looked up when the consumer started. If
not, the issues created after the start are
+ // the new ones, as all issues that exist when the consumer starts are
older
+ private volatile boolean latestIssueLookedUp;
+ // when the consumer started, by the local clock
+ private DateTime startTime;
// timezone of the current user authenticated
private DateTimeZone userTimeZone;
@@ -61,14 +73,22 @@ public class NewIssuesConsumer extends AbstractJiraConsumer
{
@Override
protected void doStart() throws Exception {
- super.doStart();
-
- latestIssue = findLatestIssue();
- if (latestIssue != null) {
- LOG.debug("Init: Latest issue: {}", latestIssue.getKey());
+ // before super.doStart(), which starts the polls: they use what is
set here
+ startTime = DateTime.now();
+ latestIssue = null;
+ latestIssueLookedUp = false;
+ // also before the lookup: the polls that follow a failed lookup need
it
+ userTimeZone = getUserTimeZone();
+ try {
+ lookUpLatestIssue();
+ } catch (Exception e) {
+ // without the latest issue every existing issue would be taken as
new: the polls ask for the issues created
+ // since the start instead
+ LOG.warn("Cannot find the latest issue at startup (the polls will
ask for the issues created since the start): {}",
+ e.getMessage(), e);
}
- userTimeZone = getUserTimeZone();
+ super.doStart();
}
/**
@@ -80,6 +100,15 @@ public class NewIssuesConsumer extends AbstractJiraConsumer
{
return
latestIssue.getCreationDate().withZone(userTimeZone).toString(JIRA_DATE_FORMAT);
}
+ /**
+ * The start of the consumer in the timezone of the user, as the JQL
expects it.
+ *
+ * @return timestamp string used in the JQL
+ */
+ private String getStartTimestamp() {
+ return startTime.withZone(userTimeZone).toString(JIRA_DATE_FORMAT);
+ }
+
/**
* Gets the timezone of the currently authenticated user. Basic auth
configuration has precedence over OAuth
* credentials as in the login process.
@@ -101,19 +130,23 @@ public class NewIssuesConsumer extends
AbstractJiraConsumer {
* @return latest {@link Issue} or null
*/
private Issue findLatestIssue() {
- try {
- // get the issues, ordered so that the latest one is the first one
returned by the query
- Queue<Issue> issues = getIssues(getEndpoint().getJql() + " ORDER
BY created DESC", 1);
- if (!issues.isEmpty()) {
- return issues.peek();
- }
- } catch (Exception e) {
- // ignore
+ // get the issues, ordered so that the latest one is the first one
returned by the query
+ Queue<Issue> issues = getIssues(getEndpoint().getJql() + " ORDER BY
created DESC", 1);
+ if (!issues.isEmpty()) {
+ return issues.peek();
}
// in case there aren't any issues...
return null;
}
+ private void lookUpLatestIssue() {
+ latestIssue = findLatestIssue();
+ latestIssueLookedUp = true;
+ if (latestIssue != null) {
+ LOG.debug("Init: Latest issue: {}", latestIssue.getKey());
+ }
+ }
+
protected int doPoll() throws Exception {
// it may happen the poll() is called while the route is doing the
initial load,
// this way we need to wait for the latestIssueId being associated to
the last indexed issue id
@@ -132,12 +165,12 @@ public class NewIssuesConsumer extends
AbstractJiraConsumer {
Queue<Issue> issues;
// If we have processed an issue before, use its timestamp to get only
the newer ones
if (latestIssue != null) {
- String jqlFilter = String.format(NEW_ISSUES_JQL_FORMAT,
getServerTimestamp(), getEndpoint().getJql());
- // all of them: the newest one becomes the latest issue, so a new
issue left out by maxResults would never
- // be returned again; maxResults is the page size here
- int maxResults = getEndpoint().getMaxResults();
- int pageSize = maxResults > 0 ? Math.min(maxResults,
SEARCH_MAX_PER_QUERY) : SEARCH_MAX_PER_QUERY;
- issues = getIssues(jqlFilter, SEARCH_START_AT, pageSize,
Integer.MAX_VALUE);
+ issues = getAllIssues(String.format(NEW_ISSUES_JQL_FORMAT,
getServerTimestamp(), getEndpoint().getJql()));
+ } else if (!latestIssueLookedUp) {
+ // the lookup failed at startup: the issues created since the
start are the new ones. The JQL returns the
+ // issues of the minute of the start too, so keep those created
after it
+ issues = getAllIssues(String.format(NEW_ISSUES_JQL_FORMAT,
getStartTimestamp(), getEndpoint().getJql()));
+ issues.removeIf(i -> !i.getCreationDate().isAfter(startTime));
} else {
issues = getIssues(getEndpoint().getJql());
}
@@ -158,4 +191,14 @@ public class NewIssuesConsumer extends
AbstractJiraConsumer {
}
return issues;
}
+
+ /**
+ * All the issues of the JQL: the newest one becomes the latest issue, so
a new issue left out by maxResults would
+ * never be returned again; maxResults is the page size here.
+ */
+ private Queue<Issue> getAllIssues(String jql) {
+ int maxResults = getEndpoint().getMaxResults();
+ int pageSize = maxResults > 0 ? Math.min(maxResults,
SEARCH_MAX_PER_QUERY) : SEARCH_MAX_PER_QUERY;
+ return getIssues(jql, SEARCH_START_AT, pageSize, Integer.MAX_VALUE);
+ }
}
diff --git
a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerCreatedSinceStartTest.java
b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerCreatedSinceStartTest.java
new file mode 100644
index 000000000000..501330dc174e
--- /dev/null
+++
b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerCreatedSinceStartTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jira.consumer;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.atlassian.jira.rest.client.api.JiraRestClient;
+import com.atlassian.jira.rest.client.api.JiraRestClientFactory;
+import com.atlassian.jira.rest.client.api.SearchRestClient;
+import com.atlassian.jira.rest.client.api.UserRestClient;
+import com.atlassian.jira.rest.client.api.domain.Issue;
+import com.atlassian.jira.rest.client.api.domain.SearchResult;
+import com.atlassian.jira.rest.client.api.domain.User;
+import io.atlassian.util.concurrent.Promises;
+import org.apache.camel.CamelContext;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jira.JiraComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.format.DateTimeFormat;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.apache.camel.component.jira.JiraConstants.JIRA;
+import static
org.apache.camel.component.jira.JiraConstants.JIRA_REST_CLIENT_FACTORY;
+import static
org.apache.camel.component.jira.JiraTestConstants.JIRA_CREDENTIALS;
+import static org.apache.camel.component.jira.JiraTestConstants.PROJECT;
+import static
org.apache.camel.component.jira.Utils.createIssueWithCreationDate;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+/**
+ * The search for the latest issue fails at startup, and so does the first
search for new issues. Once Jira answers, an
+ * issue created after the consumer started (and so found as the latest issue
by a later search for it) is routed, and
+ * an issue created before the start, in the same minute (which the JQL
returns too, as it has minutes only), is not.
+ */
+@ExtendWith(MockitoExtension.class)
+public class NewIssuesConsumerCreatedSinceStartTest extends CamelTestSupport {
+
+ // a time zone of the user far from the one of the JVM, so the JQL must
use the minute of the start in that zone
+ private static final DateTimeZone USER_ZONE =
DateTimeZone.forID("Pacific/Kiritimati");
+
+ // the issues the search returns once Jira answers, the newest first
+ private final List<Issue> found = new CopyOnWriteArrayList<>();
+ // the JQL of the searches for new issues
+ private final List<String> newIssueQueries = new CopyOnWriteArrayList<>();
+ private final AtomicInteger newIssueSearches = new AtomicInteger();
+ private final CountDownLatch threeAnsweredSearches = new CountDownLatch(3);
+ private volatile DateTime beforeStart;
+ private volatile DateTime lookupFailed;
+
+ @Mock
+ private JiraRestClient jiraClient;
+
+ @Mock
+ private JiraRestClientFactory jiraRestClientFactory;
+
+ @Mock
+ private SearchRestClient searchRestClient;
+
+ @Mock
+ private UserRestClient userRestClient;
+
+ @EndpointInject("mock:result")
+ private MockEndpoint mockResult;
+
+ @Override
+ protected void bindToRegistry(Registry registry) {
+ registry.bind(JIRA_REST_CLIENT_FACTORY, jiraRestClientFactory);
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ User user = new User(
+ null, "admin", null, null, true, null,
+ Map.of("48x48", URI.create("")), USER_ZONE.getID());
+ when(jiraClient.getSearchClient()).thenReturn(searchRestClient);
+ when(jiraClient.getUserClient()).thenReturn(userRestClient);
+ when(jiraRestClientFactory.createWithBasicHttpAuthentication(any(),
any(), any())).thenReturn(jiraClient);
+
when(userRestClient.getUser(any(URI.class))).thenReturn(Promises.promise(user));
+ when(searchRestClient.searchJql(any(), any(), any(),
any())).then(invocation -> {
+ String jql = invocation.getArgument(0);
+ if (!jql.startsWith("created > ")) {
+ // the search for the latest issue
+ if (lookupFailed != null) {
+ // a later search finds the issue created after the start
as the latest one
+ return Promises.promise(new SearchResult(0, 1, 1,
found.subList(0, 1)));
+ }
+ // it fails at startup
+ lookupFailed = DateTime.now();
+ // created after the start (which is before the failed
lookup), before Jira answers again
+ found.add(createIssueWithCreationDate(2L,
lookupFailed.plusMillis(1)));
+ // created before the start, in the same minute as far as the
JQL is concerned
+ found.add(createIssueWithCreationDate(1L,
beforeStart.minusMillis(1)));
+ throw new IllegalStateException("Service Unavailable");
+ }
+ newIssueQueries.add(jql);
+ if (newIssueSearches.getAndIncrement() == 0) {
+ // Jira still does not answer at the first poll
+ throw new IllegalStateException("Service Unavailable");
+ }
+ threeAnsweredSearches.countDown();
+ return Promises.promise(new SearchResult(0, 50, found.size(),
found));
+ });
+
+ CamelContext camelContext = super.createCamelContext();
+ camelContext.disableJMX();
+ camelContext.addComponent(JIRA, new JiraComponent(camelContext));
+ beforeStart = DateTime.now();
+ return camelContext;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("jira://newIssues?jiraUrl=" + JIRA_CREDENTIALS +
"&jql=project=" + PROJECT + "&delay=50")
+ .to(mockResult);
+ }
+ };
+ }
+
+ @Test
+ public void issueCreatedAfterTheStartIsRoutedOnceJiraAnswers() throws
Exception {
+ assertTrue(threeAnsweredSearches.await(20, TimeUnit.SECONDS), "the
consumer must search for new issues");
+
+ List<Long> routed = mockResult.getReceivedExchanges().stream()
+ .map(e ->
e.getMessage().getBody(Issue.class).getId()).toList();
+ assertEquals(List.of(2L), routed, "only the issue created after the
start is new, and it is routed once");
+
+ // the first searches ask for the issues created since the minute of
the start, in the time zone of the user
+ String query = newIssueQueries.get(0);
+ String atStart = query.substring("created > \"".length(),
query.indexOf('"', "created > \"".length()));
+ List<String> startMinutes = List.of(
+
beforeStart.withZone(USER_ZONE).toString(DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm")),
+
lookupFailed.withZone(USER_ZONE).toString(DateTimeFormat.forPattern("yyyy-MM-dd
HH:mm")));
+ assertTrue(startMinutes.contains(atStart), "the JQL " + query + " must
ask for one of " + startMinutes);
+ assertEquals(query, newIssueQueries.get(1), "the poll after the failed
one asks for the same issues");
+ }
+}
diff --git
a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerStartupLookupFailsTest.java
b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerStartupLookupFailsTest.java
new file mode 100644
index 000000000000..6a0df2a38005
--- /dev/null
+++
b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewIssuesConsumerStartupLookupFailsTest.java
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jira.consumer;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.atlassian.jira.rest.client.api.JiraRestClient;
+import com.atlassian.jira.rest.client.api.JiraRestClientFactory;
+import com.atlassian.jira.rest.client.api.SearchRestClient;
+import com.atlassian.jira.rest.client.api.UserRestClient;
+import com.atlassian.jira.rest.client.api.domain.Issue;
+import com.atlassian.jira.rest.client.api.domain.SearchResult;
+import com.atlassian.jira.rest.client.api.domain.User;
+import io.atlassian.util.concurrent.Promises;
+import org.apache.camel.CamelContext;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jira.JiraComponent;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.joda.time.DateTime;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.apache.camel.component.jira.JiraConstants.JIRA;
+import static
org.apache.camel.component.jira.JiraConstants.JIRA_REST_CLIENT_FACTORY;
+import static
org.apache.camel.component.jira.JiraTestConstants.JIRA_CREDENTIALS;
+import static org.apache.camel.component.jira.JiraTestConstants.PROJECT;
+import static
org.apache.camel.component.jira.Utils.createIssueWithCreationDate;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+/**
+ * The search for the latest issue at startup fails (for example the server
answers 503 once): the issues that exist
+ * when the consumer starts must not be routed as new issues, and the issues
created later must be.
+ */
+@ExtendWith(MockitoExtension.class)
+public class NewIssuesConsumerStartupLookupFailsTest extends CamelTestSupport {
+
+ private static final List<Issue> EXISTING = List.of(
+ createIssueWithCreationDate(3L, DateTime.now().minusMinutes(6)),
+ createIssueWithCreationDate(2L, DateTime.now().minusMinutes(8)),
+ createIssueWithCreationDate(1L, DateTime.now().minusMinutes(10)));
+ private static final Issue NEW_ISSUE = createIssueWithCreationDate(4L,
DateTime.now().plusMinutes(1));
+
+ private final AtomicInteger latestIssueSearches = new AtomicInteger();
+ private final AtomicInteger newIssueSearches = new AtomicInteger();
+ private final CountDownLatch threeNewIssueSearches = new CountDownLatch(3);
+
+ @Mock
+ private JiraRestClient jiraClient;
+
+ @Mock
+ private JiraRestClientFactory jiraRestClientFactory;
+
+ @Mock
+ private SearchRestClient searchRestClient;
+
+ @Mock
+ private UserRestClient userRestClient;
+
+ @EndpointInject("mock:result")
+ private MockEndpoint mockResult;
+
+ @Override
+ protected void bindToRegistry(Registry registry) {
+ registry.bind(JIRA_REST_CLIENT_FACTORY, jiraRestClientFactory);
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ User user = new User(
+ null, "admin", null, null, true, null,
+ Map.of("48x48", URI.create("")),
DateTime.now().getZone().getID());
+ when(jiraClient.getSearchClient()).thenReturn(searchRestClient);
+ when(jiraClient.getUserClient()).thenReturn(userRestClient);
+ when(jiraRestClientFactory.createWithBasicHttpAuthentication(any(),
any(), any())).thenReturn(jiraClient);
+
when(userRestClient.getUser(any(URI.class))).thenReturn(Promises.promise(user));
+ when(searchRestClient.searchJql(any(), any(), any(),
any())).then(invocation -> {
+ String jql = invocation.getArgument(0);
+ List<Issue> issues;
+ if (jql.startsWith("created > ")) {
+ // the newer issues: one issue is created after the consumer
started
+ issues = newIssueSearches.getAndIncrement() == 0 ?
List.of(NEW_ISSUE) : List.of();
+ threeNewIssueSearches.countDown();
+ } else if (jql.endsWith(" ORDER BY created DESC")) {
+ // the latest issue: the first search fails
+ if (latestIssueSearches.getAndIncrement() == 0) {
+ throw new IllegalStateException("Service Unavailable");
+ }
+ issues = EXISTING.subList(0, 1);
+ } else {
+ // all issues of the JQL, which all exist since before the
consumer started
+ issues = EXISTING;
+ }
+ return Promises.promise(new SearchResult(0, 50, issues.size(),
issues));
+ });
+
+ CamelContext camelContext = super.createCamelContext();
+ camelContext.disableJMX();
+ camelContext.addComponent(JIRA, new JiraComponent(camelContext));
+ return camelContext;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("jira://newIssues?jiraUrl=" + JIRA_CREDENTIALS +
"&jql=project=" + PROJECT + "&delay=50")
+ .to(mockResult);
+ }
+ };
+ }
+
+ @Test
+ public void existingIssuesAreNotRoutedWhenTheStartupLookupFailed() throws
Exception {
+ assertTrue(threeNewIssueSearches.await(20, TimeUnit.SECONDS), "the
consumer must search for new issues");
+
+ List<Object> bodies = mockResult.getReceivedExchanges().stream().map(e
-> e.getMessage().getBody()).toList();
+ assertEquals(List.of(NEW_ISSUE), bodies, "only the issue created after
the start is new");
+ assertEquals(1, latestIssueSearches.get(),
+ "the polls ask for the issues created since the start, not for
the latest issue again");
+ }
+}