@Test public void translateToReadRequest_nullResourceModel() { assertThatThrownBy(() -> Translator.translateToReadRequest(null)) .hasNoCause() .hasMessageStartingWith("model is marked") .isExactlyInstanceOf(NullPointerException.class); }
static DescribeTypeRequest translateToReadRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return DescribeTypeRequest.builder() .arn(model.getArn()) .build(); } else { return DescribeTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }
Translator { static DescribeTypeRequest translateToReadRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return DescribeTypeRequest.builder() .arn(model.getArn()) .build(); } else { return DescribeTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } } }
Translator { static DescribeTypeRequest translateToReadRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return DescribeTypeRequest.builder() .arn(model.getArn()) .build(); } else { return DescribeTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }  }
Translator { static DescribeTypeRequest translateToReadRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return DescribeTypeRequest.builder() .arn(model.getArn()) .build(); } else { return DescribeTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }   }
Translator { static DescribeTypeRequest translateToReadRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return DescribeTypeRequest.builder() .arn(model.getArn()) .build(); } else { return DescribeTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }    }