@Test public void translateToDeleteRequest_nullResourceModel() { assertThatThrownBy(() -> Translator.translateToDeleteRequest(null, logger)) .hasNoCause() .hasMessageStartingWith("model is marked") .isExactlyInstanceOf(NullPointerException.class); }
static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } } }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }  }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }   }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }    }