diff --git a/pom.xml b/pom.xml index 6065f1c..0a6a4a5 100644 --- a/pom.xml +++ b/pom.xml @@ -248,6 +248,12 @@ runtime + + io.micronaut + micronaut-jackson-databind + 4.4.6 + + org.apache.httpcomponents diff --git a/src/test/java/org/signal/registration/json/JsonMapperInjectionIntegrationTest.java b/src/test/java/org/signal/registration/json/JsonMapperInjectionIntegrationTest.java new file mode 100644 index 0000000..1e44b7e --- /dev/null +++ b/src/test/java/org/signal/registration/json/JsonMapperInjectionIntegrationTest.java @@ -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 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"); + } + +}