Skip to content

Instantly share code, notes, and snippets.

@Sam-Kruglov
Sam-Kruglov / BookingServiceTest.java
Created April 30, 2019 19:13
Defining the sample code
import org.junit.jupiter.api.Test;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Sam-Kruglov
Sam-Kruglov / AxonIntegrationTest.java
Last active November 21, 2019 17:45
Axon test util for waiting for some events
class AxonIntegrationTest extends AbstractIntegrationTest {
@Test
void create_document_in_google_docs__propagate_to_ms_word_online(@Autowired EventBus eventBus){
AxonTestUtil.executeAndWaitForEvents(
() -> documentService.createGoogleDocument(...),
eventBus, 2, DocumentSavedEvent.class
);
//instead of this:
//documentService.createGoogleDocument(...);
package mypackage;
import mypackage.Identifiable;
import java.util.Objects;
import java.util.Set;
public final class EntitySetUtil {
private EntitySetUtil() {
// not meant to be initialized