@Test void dtoToAuthentication() { AuthenticationDto dto = AuthenticationDto.builder() .withLoginUserName(LOGIN) .withPublicKey(PUBLIC_KEY) .withPublicKeyId(PUBLIC_KEY_ID) .withManagedKey(true) .build(); EnvironmentAuthentication result = underTest.dtoToAuthentication(dto); assertThat(result) .matches(m -> Objects.equals(m.getLoginUserName(), dto.getLoginUserName())) .matches(m -> Objects.equals(m.getPublicKey(), dto.getPublicKey())) .matches(m -> Objects.equals(m.getPublicKeyId(), dto.getPublicKeyId())) .matches(m -> Objects.equals(m.isManagedKey(), dto.isManagedKey())); }
public EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto) { EnvironmentAuthentication environmentAuthentication = new EnvironmentAuthentication(); environmentAuthentication.setLoginUserName(authenticationDto.getLoginUserName()); environmentAuthentication.setPublicKey(authenticationDto.getPublicKey()); environmentAuthentication.setPublicKeyId(authenticationDto.getPublicKeyId()); environmentAuthentication.setManagedKey(authenticationDto.isManagedKey()); return environmentAuthentication; }
AuthenticationDtoConverter { public EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto) { EnvironmentAuthentication environmentAuthentication = new EnvironmentAuthentication(); environmentAuthentication.setLoginUserName(authenticationDto.getLoginUserName()); environmentAuthentication.setPublicKey(authenticationDto.getPublicKey()); environmentAuthentication.setPublicKeyId(authenticationDto.getPublicKeyId()); environmentAuthentication.setManagedKey(authenticationDto.isManagedKey()); return environmentAuthentication; } }
AuthenticationDtoConverter { public EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto) { EnvironmentAuthentication environmentAuthentication = new EnvironmentAuthentication(); environmentAuthentication.setLoginUserName(authenticationDto.getLoginUserName()); environmentAuthentication.setPublicKey(authenticationDto.getPublicKey()); environmentAuthentication.setPublicKeyId(authenticationDto.getPublicKeyId()); environmentAuthentication.setManagedKey(authenticationDto.isManagedKey()); return environmentAuthentication; }  }
AuthenticationDtoConverter { public EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto) { EnvironmentAuthentication environmentAuthentication = new EnvironmentAuthentication(); environmentAuthentication.setLoginUserName(authenticationDto.getLoginUserName()); environmentAuthentication.setPublicKey(authenticationDto.getPublicKey()); environmentAuthentication.setPublicKeyId(authenticationDto.getPublicKeyId()); environmentAuthentication.setManagedKey(authenticationDto.isManagedKey()); return environmentAuthentication; }  EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto); AuthenticationDto authenticationToDto(EnvironmentAuthentication authentication); }
AuthenticationDtoConverter { public EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto) { EnvironmentAuthentication environmentAuthentication = new EnvironmentAuthentication(); environmentAuthentication.setLoginUserName(authenticationDto.getLoginUserName()); environmentAuthentication.setPublicKey(authenticationDto.getPublicKey()); environmentAuthentication.setPublicKeyId(authenticationDto.getPublicKeyId()); environmentAuthentication.setManagedKey(authenticationDto.isManagedKey()); return environmentAuthentication; }  EnvironmentAuthentication dtoToAuthentication(AuthenticationDto authenticationDto); AuthenticationDto authenticationToDto(EnvironmentAuthentication authentication);  }