@Test
public void testEKSOriginResolvesOverECSOrigin() {

    //given
    ECSPlugin ecsPlugin = Mockito.mock(ECSPlugin.class);
    EKSPlugin eksPlugin = Mockito.mock(EKSPlugin.class);
    Map<String, Object> runtimeContext = new HashMap<>();
    runtimeContext.put("key", "value");
    Mockito.doReturn(true).when(ecsPlugin).isEnabled();
    Mockito.doReturn(runtimeContext).when(ecsPlugin).getRuntimeContext();
    Mockito.doReturn("ecs").when(ecsPlugin).getServiceName();
    Mockito.doReturn(ECSPlugin.ORIGIN).when(ecsPlugin).getOrigin();
    Mockito.doReturn(true).when(eksPlugin).isEnabled();
    Mockito.doReturn(runtimeContext).when(eksPlugin).getRuntimeContext();
    Mockito.doReturn("eks").when(eksPlugin).getServiceName();
    Mockito.doReturn(EKSPlugin.ORIGIN).when(eksPlugin).getOrigin();
    AWSXRayRecorder recorder = AWSXRayRecorderBuilder.standard()
                                                     .withPlugin(eksPlugin)
                                                     .withPlugin(ecsPlugin)
                                                     .build();
    // when
    Assert.assertEquals(EKSPlugin.ORIGIN, recorder.getOrigin());
}