@Test
public void testGetInstanceId() {

    InstanceAWSECSProvider provider = new InstanceAWSECSProvider();
    provider.initialize("provider", "com.yahoo.athenz.instance.provider.impl.InstanceAWSECSProvider", null, null);
    AWSAttestationData data = new AWSAttestationData();
    data.setTaskid("task1234");
    assertEquals(provider.getInstanceId(data, null), "task1234");
    
    data.setTaskid(null);
    Struct doc = new Struct();
    doc.put(InstanceAWSProvider.ATTR_INSTANCE_ID, "data1234");
    assertEquals(provider.getInstanceId(data, doc), "data1234");
    data.setTaskid("");
    assertEquals(provider.getInstanceId(data, doc), "data1234");
    
    data.setTaskid("task1234");
    assertEquals(provider.getInstanceId(data, doc), "task1234");
}