@Test public void testConvertWithDefaults() { FreeIpaCreationDto request = FreeIpaCreationDto.builder().build(); FreeIpaResponse result = underTest.convert(request); assertNotNull(result); assertNotNull(result.getInstanceCountByGroup()); assertEquals(1, result.getInstanceCountByGroup()); assertNull(result.getAws()); }
public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) { if (freeIpaCreation == null) { return null; } else { FreeIpaResponse response = new FreeIpaResponse(); response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup()); Optional.ofNullable(freeIpaCreation.getAws()) .map(this::convertAws) .ifPresent(response::setAws); return response; } }
FreeIpaConverter { public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) { if (freeIpaCreation == null) { return null; } else { FreeIpaResponse response = new FreeIpaResponse(); response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup()); Optional.ofNullable(freeIpaCreation.getAws()) .map(this::convertAws) .ifPresent(response::setAws); return response; } } }
FreeIpaConverter { public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) { if (freeIpaCreation == null) { return null; } else { FreeIpaResponse response = new FreeIpaResponse(); response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup()); Optional.ofNullable(freeIpaCreation.getAws()) .map(this::convertAws) .ifPresent(response::setAws); return response; } }  }
FreeIpaConverter { public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) { if (freeIpaCreation == null) { return null; } else { FreeIpaResponse response = new FreeIpaResponse(); response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup()); Optional.ofNullable(freeIpaCreation.getAws()) .map(this::convertAws) .ifPresent(response::setAws); return response; } }  FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation); FreeIpaCreationDto convert(AttachedFreeIpaRequest request); }
FreeIpaConverter { public FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation) { if (freeIpaCreation == null) { return null; } else { FreeIpaResponse response = new FreeIpaResponse(); response.setInstanceCountByGroup(freeIpaCreation.getInstanceCountByGroup()); Optional.ofNullable(freeIpaCreation.getAws()) .map(this::convertAws) .ifPresent(response::setAws); return response; } }  FreeIpaResponse convert(FreeIpaCreationDto freeIpaCreation); FreeIpaCreationDto convert(AttachedFreeIpaRequest request);  }