@Test
public void coreTaskLogAttributes() {

    String taskId = "tid-1";
    String uiLocation = "http://titus-ui/tasks/" + taskId;
    String s3Bucket = "bucket-1";
    String s3Key = "key-1";
    String s3AccountId = "acc-1";
    String s3AccountName = "acc-name-1";
    String s3Region = "us-east-1";
    Map<String, String> taskContext = new HashMap<>();
    taskContext.put(TASK_ATTRIBUTES_TASK_ORIGINAL_ID, taskId);
    taskContext.put(TASK_ATTRIBUTES_RESUBMIT_NUMBER, "1");
    Task grpcTask = Task.newBuilder()
            .setId(taskId)
            .putAllTaskContext(taskContext)
            .setLogLocation(LogLocation.newBuilder()
                    .setUi(LogLocation.UI.newBuilder().setUrl(uiLocation))
                    .setS3(LogLocation.S3.newBuilder()
                            .setRegion(s3Region)
                            .setBucket(s3Bucket)
                            .setKey(s3Key)
                            .setAccountId(s3AccountId)
                            .setAccountName(s3AccountName))
                    .build())
            .build();
    com.netflix.titus.api.jobmanager.model.job.Task coreTask = GrpcJobManagementModelConverters.toCoreTask(grpcTask);
    assertThat(coreTask).isNotNull();
    assertThat(coreTask.getAttributes()).hasSizeGreaterThan(0);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_S3_KEY)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_S3_KEY)).isEqualTo(s3Key);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_S3_BUCKET_NAME)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_S3_BUCKET_NAME)).isEqualTo(s3Bucket);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_S3_ACCOUNT_ID)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_S3_ACCOUNT_ID)).isEqualTo(s3AccountId);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_S3_ACCOUNT_NAME)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_S3_ACCOUNT_NAME)).isEqualTo(s3AccountName);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_S3_REGION)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_S3_REGION)).isEqualTo(s3Region);
    assertThat(coreTask.getAttributes().containsKey(TASK_ATTRIBUTE_LOG_UI_LOCATION)).isTrue();
    assertThat(coreTask.getAttributes().get(TASK_ATTRIBUTE_LOG_UI_LOCATION)).isEqualTo(uiLocation);
}