-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve simple messageBus test and compine with MessageBusService; fi…
…x issue with observationStoppedThrough -> put execution to AutoClosable close() method!
- Loading branch information
Showing
5 changed files
with
76 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/test/java/com/recom/service/messagebus/MessageBusServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.recom.service.messagebus; | ||
|
||
import com.recom.model.message.MessageContainer; | ||
import com.recom.observer.Subjective; | ||
import com.recom.persistence.message.MessagePersistenceLayer; | ||
import lombok.NonNull; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
@ExtendWith(MockitoExtension.class) | ||
class MessageBusServiceTest { | ||
|
||
@Mock | ||
@NonNull | ||
private MessagePersistenceLayer messagePersistenceLayer; | ||
@InjectMocks | ||
private MessageBusService serviceUnderTest; | ||
|
||
@Test | ||
void sendMessage() { | ||
// Arrange | ||
// Act | ||
serviceUnderTest.sendMessage("mapName", new MessageContainer()); | ||
// Assert | ||
} | ||
|
||
@Test | ||
void listMessagesSince() { | ||
// Arrange | ||
// Act | ||
serviceUnderTest.listMessagesSince("mapName", 0L); | ||
// Assert | ||
} | ||
|
||
@Test | ||
void getSubject() { | ||
// Arrange | ||
// Act | ||
final Subjective<MessageContainer> resultToTest = serviceUnderTest.getSubject(); | ||
// Assert | ||
assertNotNull(resultToTest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters