Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stanchev Aleksandar <aleksandar.stanchev@bosch.com>
  • Loading branch information
alstanchev authored and Aleksandar Stanchev committed Aug 28, 2023
1 parent 7558cf5 commit 0ca675c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public <S extends ThingEvent<?>> Object wrapForPublicationWithAcks(final S messa
null,
policyEnforcerProvider,
Mockito.mock(MongoReadJournal.class)
).withDispatcher("org.apache.pekko.actor.default-dispatcher"), system.guardian(),
).withDispatcher("pekko.actor.default-dispatcher"), system.guardian(),
URLEncoder.encode(THING_ID.toString(), Charset.defaultCharset()));
// Actors using "stash()" require the above dispatcher to be configured, otherwise stash() and unstashAll() won't
// work like in the "normal" actor!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import org.apache.pekko.NotUsed;
import org.apache.pekko.actor.ActorSystem;
//import org.apache.pekko.persistence.inmemory.query.javadsl.InMemoryReadJournal;
import org.apache.pekko.persistence.inmemory.query.javadsl.InMemoryReadJournal;
import org.apache.pekko.persistence.query.EventEnvelope;
import org.apache.pekko.persistence.query.PersistenceQuery;
import org.apache.pekko.stream.javadsl.Sink;
Expand All @@ -46,7 +46,7 @@ public final class ThingsJournalTestHelper<J> {
private static final int WAIT_TIMEOUT = 3;
private final Function<ThingId, String> domainIdToPersistenceId;
private final BiFunction<BsonDocument, Long, J> journalEntryToDomainObject;
// private final InMemoryReadJournal readJournal;
private final InMemoryReadJournal readJournal;
private final ActorSystem actorSystem;

/**
Expand All @@ -64,8 +64,8 @@ public ThingsJournalTestHelper(final ActorSystem actorSystem,
this.journalEntryToDomainObject = requireNonNull(journalEntryToDomainObject);
this.domainIdToPersistenceId = requireNonNull(domainIdToPersistenceId);

// readJournal = PersistenceQuery.get(actorSystem).
// getReadJournalFor(InMemoryReadJournal.class, InMemoryReadJournal.Identifier());
readJournal = PersistenceQuery.get(actorSystem).
getReadJournalFor(InMemoryReadJournal.class, InMemoryReadJournal.Identifier());
this.actorSystem = actorSystem;
}

Expand All @@ -83,8 +83,7 @@ public List<J> getAllEvents(final ThingId thingId) {
}

private List<EventEnvelope> getAllEventEnvelopes(final String persistenceId) {
return null;
// return runBlockingWithReturn(readJournal.currentEventsByPersistenceId(persistenceId, 0, Long.MAX_VALUE));
return runBlockingWithReturn(readJournal.currentEventsByPersistenceId(persistenceId, 0, Long.MAX_VALUE));
}

private J convertEventEnvelopeToDomainObject(final EventEnvelope eventEnvelope) {
Expand Down
2 changes: 1 addition & 1 deletion things/service/src/test/resources/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pekko.persistence {
}

pekko-contrib-mongodb-persistence-things-journal {
class = "pekko.persistence.inmemory.journal.InMemoryAsyncWriteJournal"
class = "org.apache.pekko.persistence.inmemory.journal.InMemoryAsyncWriteJournal"
plugin-dispatcher = "thing-persistence-dispatcher"

ask-timeout = 10s
Expand Down
2 changes: 1 addition & 1 deletion thingsearch/service/src/test/resources/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pekko {
json = "org.eclipse.ditto.internal.utils.cluster.JsonJsonifiableSerializer"
cbor = "org.eclipse.ditto.internal.utils.cluster.CborJsonifiableSerializer"
cbor-json-value = "org.eclipse.ditto.internal.utils.cluster.CborJsonValueSerializer"
jackson-cbor = "pekko.serialization.jackson.JacksonCborSerializer"
jackson-cbor = "org.apache.pekko.serialization.jackson.JacksonCborSerializer"
}

serialization-bindings {
Expand Down

0 comments on commit 0ca675c

Please sign in to comment.