Skip to content

Commit

Permalink
Add explicit micronaut-jackson-databind dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
eager-signal committed Jul 24, 2024
1 parent 021747f commit fe2b360
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-jackson-databind</artifactId>
<version>4.4.6</version>
</dependency>

<!-- required to fix transitive exclusion by google-cloud-bigtable -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
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");
}

}

0 comments on commit fe2b360

Please sign in to comment.