@Override
    public void afterMethod(final TargetAdviceObject target, final TargetAdviceMethod method, final Object[] args, final Object result, final String pluginType) {
        if ("createContextManager".equals(method.getName())) {
            ShardingSphereDataSourceContextHolder.put(((ContextManager) result).getComputeNodeInstanceContext().getInstance().getMetaData().getId(),
                    new ShardingSphereDataSourceContext(AgentReflectionUtils.getFieldValue(target, "databaseName"), (ContextManager) result));
        }
    }
@Test
    void assertAfterMethod() {
        assertThat(ShardingSphereDataSourceContextHolder.getShardingSphereDataSourceContexts().size(), is(0));
        when(AgentReflectionUtils.getFieldValue(fixture, "databaseName")).thenReturn(databaseName);
        TargetAdviceMethod method = mock(TargetAdviceMethod.class);
        when(method.getName()).thenReturn("createContextManager");
        ShardingSphereDataSourceAdvice advice = new ShardingSphereDataSourceAdvice();
        ContextManager contextManager = mockContextManager();
        advice.afterMethod(fixture, method, new Object[]{}, contextManager, "FIXTURE");
        assertThat(ShardingSphereDataSourceContextHolder.getShardingSphereDataSourceContexts().size(), is(1));
        assertThat(ShardingSphereDataSourceContextHolder.getShardingSphereDataSourceContexts().keySet().iterator().next(), is(instanceId));
        assertThat(ShardingSphereDataSourceContextHolder.getShardingSphereDataSourceContexts().get(instanceId).getDatabaseName(), is(databaseName));
    }