@Test public void translateFromReadResponse_nullResourceModel() { assertThatThrownBy(() -> Translator.translateFromReadResponse(null)) .hasNoCause() .hasMessageStartingWith("awsResponse is marked") .isExactlyInstanceOf(NullPointerException.class); }
static ResourceModel translateFromReadResponse(@NonNull final DescribeTypeResponse awsResponse) { final ResourceModel.ResourceModelBuilder builder = ResourceModel.builder() .arn(awsResponse.arn()) .description(awsResponse.description()) .documentationUrl(awsResponse.documentationUrl()) .executionRoleArn(awsResponse.executionRoleArn()) .isDefaultVersion(awsResponse.isDefaultVersion()) .provisioningType(awsResponse.provisioningTypeAsString()) .schema(awsResponse.schema()) .sourceUrl(awsResponse.sourceUrl()) .typeName(awsResponse.typeName()) .versionId(awsResponse.arn().substring(awsResponse.arn().lastIndexOf('/') + 1)) .visibility(awsResponse.visibilityAsString()); if (awsResponse.lastUpdated() != null) { builder.lastUpdated(awsResponse.lastUpdated().toString()); } if (awsResponse.timeCreated() != null) { builder.timeCreated(awsResponse.timeCreated().toString()); } if (awsResponse.loggingConfig() != null) { builder.loggingConfig(translateFromSDK(awsResponse.loggingConfig())); } return builder.build(); }
Translator { static ResourceModel translateFromReadResponse(@NonNull final DescribeTypeResponse awsResponse) { final ResourceModel.ResourceModelBuilder builder = ResourceModel.builder() .arn(awsResponse.arn()) .description(awsResponse.description()) .documentationUrl(awsResponse.documentationUrl()) .executionRoleArn(awsResponse.executionRoleArn()) .isDefaultVersion(awsResponse.isDefaultVersion()) .provisioningType(awsResponse.provisioningTypeAsString()) .schema(awsResponse.schema()) .sourceUrl(awsResponse.sourceUrl()) .typeName(awsResponse.typeName()) .versionId(awsResponse.arn().substring(awsResponse.arn().lastIndexOf('/') + 1)) .visibility(awsResponse.visibilityAsString()); if (awsResponse.lastUpdated() != null) { builder.lastUpdated(awsResponse.lastUpdated().toString()); } if (awsResponse.timeCreated() != null) { builder.timeCreated(awsResponse.timeCreated().toString()); } if (awsResponse.loggingConfig() != null) { builder.loggingConfig(translateFromSDK(awsResponse.loggingConfig())); } return builder.build(); } }
Translator { static ResourceModel translateFromReadResponse(@NonNull final DescribeTypeResponse awsResponse) { final ResourceModel.ResourceModelBuilder builder = ResourceModel.builder() .arn(awsResponse.arn()) .description(awsResponse.description()) .documentationUrl(awsResponse.documentationUrl()) .executionRoleArn(awsResponse.executionRoleArn()) .isDefaultVersion(awsResponse.isDefaultVersion()) .provisioningType(awsResponse.provisioningTypeAsString()) .schema(awsResponse.schema()) .sourceUrl(awsResponse.sourceUrl()) .typeName(awsResponse.typeName()) .versionId(awsResponse.arn().substring(awsResponse.arn().lastIndexOf('/') + 1)) .visibility(awsResponse.visibilityAsString()); if (awsResponse.lastUpdated() != null) { builder.lastUpdated(awsResponse.lastUpdated().toString()); } if (awsResponse.timeCreated() != null) { builder.timeCreated(awsResponse.timeCreated().toString()); } if (awsResponse.loggingConfig() != null) { builder.loggingConfig(translateFromSDK(awsResponse.loggingConfig())); } return builder.build(); }  }
Translator { static ResourceModel translateFromReadResponse(@NonNull final DescribeTypeResponse awsResponse) { final ResourceModel.ResourceModelBuilder builder = ResourceModel.builder() .arn(awsResponse.arn()) .description(awsResponse.description()) .documentationUrl(awsResponse.documentationUrl()) .executionRoleArn(awsResponse.executionRoleArn()) .isDefaultVersion(awsResponse.isDefaultVersion()) .provisioningType(awsResponse.provisioningTypeAsString()) .schema(awsResponse.schema()) .sourceUrl(awsResponse.sourceUrl()) .typeName(awsResponse.typeName()) .versionId(awsResponse.arn().substring(awsResponse.arn().lastIndexOf('/') + 1)) .visibility(awsResponse.visibilityAsString()); if (awsResponse.lastUpdated() != null) { builder.lastUpdated(awsResponse.lastUpdated().toString()); } if (awsResponse.timeCreated() != null) { builder.timeCreated(awsResponse.timeCreated().toString()); } if (awsResponse.loggingConfig() != null) { builder.loggingConfig(translateFromSDK(awsResponse.loggingConfig())); } return builder.build(); }   }
Translator { static ResourceModel translateFromReadResponse(@NonNull final DescribeTypeResponse awsResponse) { final ResourceModel.ResourceModelBuilder builder = ResourceModel.builder() .arn(awsResponse.arn()) .description(awsResponse.description()) .documentationUrl(awsResponse.documentationUrl()) .executionRoleArn(awsResponse.executionRoleArn()) .isDefaultVersion(awsResponse.isDefaultVersion()) .provisioningType(awsResponse.provisioningTypeAsString()) .schema(awsResponse.schema()) .sourceUrl(awsResponse.sourceUrl()) .typeName(awsResponse.typeName()) .versionId(awsResponse.arn().substring(awsResponse.arn().lastIndexOf('/') + 1)) .visibility(awsResponse.visibilityAsString()); if (awsResponse.lastUpdated() != null) { builder.lastUpdated(awsResponse.lastUpdated().toString()); } if (awsResponse.timeCreated() != null) { builder.timeCreated(awsResponse.timeCreated().toString()); } if (awsResponse.loggingConfig() != null) { builder.loggingConfig(translateFromSDK(awsResponse.loggingConfig())); } return builder.build(); }    }