### Question:
OAuthClientDetailsMapper implements DataMapper<OAuthClientDetails, OAuthClientDetailsDto> { @Override public OAuthClientDetails mapDtoToEntity(OAuthClientDetailsDto input) { OAuthClientDetails oauthClientDetails = new OAuthClientDetails(); oauthClientDetails.setClientId(input.getClientId()); oauthClientDetails.setClientSecret(input.getClientSecret()); oauthClientDetails.setWebServerRedirectUri(input.getWebServerRedirectUri()); oauthClientDetails.setAccessTokenValidity(input.getAccessTokenValidity()); oauthClientDetails.setRefreshTokenValidity(input.getRefreshTokenValidity()); return oauthClientDetails; }  @Override OAuthClientDetails mapDtoToEntity(OAuthClientDetailsDto input); @Override OAuthClientDetailsDto mapEntityToDto(OAuthClientDetails input); @Override Collection<OAuthClientDetails> mapDtosToEntities(Collection<OAuthClientDetailsDto> input); @Override Collection<OAuthClientDetailsDto> mapEntitiesToDtos(Collection<OAuthClientDetails> input);  }### Answer:
@Test public void mapDtoToEntity_expectAllMapped() { oauthClientDetailsDto.setClientId("Test123"); oauthClientDetailsDto.setClientSecret("TestABC"); oauthClientDetailsDto.setRefreshTokenValidity(10); oauthClientDetailsDto.setAccessTokenValidity(10); oauthClientDetailsDto.setWebServerRedirectUri("localhost"); oauthClientDetails = oauthClientDetailsMapper.mapDtoToEntity(oauthClientDetailsDto); assertEquals(oauthClientDetailsDto.getClientId(), oauthClientDetails.getClientId()); assertEquals(oauthClientDetailsDto.getClientSecret(), oauthClientDetails.getClientSecret()); assertEquals( oauthClientDetailsDto.getRefreshTokenValidity(), oauthClientDetails.getRefreshTokenValidity()); assertEquals( oauthClientDetailsDto.getAccessTokenValidity(), oauthClientDetails.getAccessTokenValidity()); assertEquals( oauthClientDetailsDto.getWebServerRedirectUri(), oauthClientDetails.getWebServerRedirectUri()); }