in component-test/src/main/java/org/apache/fineract/cn/rhythm/AbstractRhythmTest.java [155:172]
Beat createBeatForThisHour(final String applicationIdentifier, final String beatIdentifier) throws InterruptedException {
final LocalDateTime now = LocalDateTime.now(ZoneId.of("UTC"));
int alignmentHour = now.getHour();
final LocalDateTime expectedBeatTimestamp = getExpectedBeatTimestamp(now, alignmentHour);
Mockito.doAnswer(new Returns(true)).when(beatPublisherServiceMock).publishBeat(
Matchers.eq(beatIdentifier),
Matchers.eq(tenantDataStoreContext.getTenantName()),
Matchers.eq(applicationIdentifier),
Matchers.eq(expectedBeatTimestamp));
final Beat ret = createBeat(applicationIdentifier, beatIdentifier, alignmentHour, expectedBeatTimestamp);
Mockito.verify(beatPublisherServiceMock, Mockito.timeout(2_000).times(1))
.publishBeat(beatIdentifier, tenantDataStoreContext.getTenantName(), applicationIdentifier, expectedBeatTimestamp);
return ret;
}