-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit micronaut-jackson-databind dependency
- Loading branch information
1 parent
021747f
commit fe2b360
Showing
2 changed files
with
42 additions
and
0 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
36 changes: 36 additions & 0 deletions
36
src/test/java/org/signal/registration/json/JsonMapperInjectionIntegrationTest.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,36 @@ | ||
package org.signal.registration.json; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.mockito.Mockito.mock; | ||
|
||
import com.google.i18n.phonenumbers.Phonenumber; | ||
import io.micronaut.json.JsonMapper; | ||
import io.micronaut.test.annotation.MockBean; | ||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
import org.junit.jupiter.api.Test; | ||
import org.signal.registration.ratelimit.RateLimiter; | ||
import org.signal.registration.sender.SenderSelectionStrategy; | ||
|
||
@MicronautTest | ||
public class JsonMapperInjectionIntegrationTest { | ||
|
||
@MockBean | ||
SenderSelectionStrategy senderSelectionStrategy = mock(SenderSelectionStrategy.class); | ||
|
||
@SuppressWarnings("unchecked") | ||
@MockBean(named = "session-creation") | ||
@Named("session-creation") | ||
RateLimiter<Phonenumber.PhoneNumber> sessionCreationRateLimiter = mock(RateLimiter.class); | ||
|
||
@Inject | ||
JsonMapper jsonMapper; | ||
|
||
@Test | ||
void testJsonMapper() { | ||
// This won't actually fail - the failure will happen in the beforeEach that looks for the bean | ||
assertNotNull(jsonMapper, "a json mapper must be available for injection"); | ||
} | ||
|
||
} |