DbMapper { public Speaker fromAppSpeaker(@Nullable com.nilhcem.devoxxfr.data.app.model.Speaker from) { if (from == null) { return null; } return new Speaker(from.getId(), from.getName(), from.getTitle(), from.getBio(), from.getWebsite(), from.getTwitter(), from.getGithub(), from.getPhoto()); } @Inject  DbMapper(Moshi moshi, AppMapper appMapper, LocalDateTimeAdapter localDateTimeAdapter); List<com.nilhcem.devoxxfr.data.app.model.Session> toAppSessions(@NonNull List<Session> from, @NonNull Map<Integer, com.nilhcem.devoxxfr.data.app.model.Speaker> speakersMap); Session fromAppSession(@Nullable com.nilhcem.devoxxfr.data.app.model.Session from); Speaker fromAppSpeaker(@Nullable com.nilhcem.devoxxfr.data.app.model.Speaker from); List<com.nilhcem.devoxxfr.data.app.model.Speaker> toAppSpeakers(@Nullable List<Speaker> from);  }
@Test public void should_convert_app_speaker_to_db_speaker() { Speaker speaker = new Speaker(10, "name", "title", "bio", "website", "twitter", "github", "photo"); com.nilhcem.devoxxfr.data.database.model.Speaker result = dbMapper.fromAppSpeaker(speaker); assertThat(result.id).isEqualTo(10); assertThat(result.name).isEqualTo("name"); assertThat(result.title).isEqualTo("title"); assertThat(result.bio).isEqualTo("bio"); assertThat(result.website).isEqualTo("website"); assertThat(result.twitter).isEqualTo("twitter"); assertThat(result.github).isEqualTo("github"); assertThat(result.photo).isEqualTo("photo"); }