@Test public void testConvertWithNull() { FreeIpaCreationDto request = null; FreeIpaResponse result = underTest.convert(request); assertNull(result); }
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);  }