@Override
    public ExecuteContext doBefore(ExecuteContext context) {
        if (!(context.getArguments()[0] instanceof Registration)) {
            return context;
        }
        final Registration registration = (Registration) context.getArguments()[0];
        GraceHelper.configWarmUpParams(registration.getMetadata(),
                PluginConfigManager.getPluginConfig(GraceConfig.class));
        ZoneUtils.setZone(registration.getMetadata());
        fillClientInfo(registration);
        if (super.isEnabled()) {
            final RegisterCenterService service = PluginServiceManager.getPluginService(RegisterCenterService.class);
            final FixedResult fixedResult = new FixedResult();
            service.register(fixedResult);
            if (fixedResult.isSkip()) {
                context.skip(fixedResult.getResult());
            }
        }
        return context;
    }
@Test
    public void doBefore() throws NoSuchMethodException {
        REGISTER_CONFIG.setOpenMigration(true);
        REGISTER_CONFIG.setEnableSpringRegister(true);
        String host = "localhost";
        String serviceName = "test";
        int port = 8080;
        Map<String, String> meta = new HashMap<>();
        Mockito.when(registration.getHost()).thenReturn(host);
        Mockito.when(registration.getServiceId()).thenReturn(serviceName);
        Mockito.when(registration.getPort()).thenReturn(port);
        Mockito.when(registration.getMetadata()).thenReturn(meta);
        final ExecuteContext context = interceptor.doBefore(buildContext(this, new Object[] {registration}));
        Assert.assertTrue(context.isSkip());
        final ClientInfo clientInfo = RegisterContext.INSTANCE.getClientInfo();
        Assert.assertEquals(clientInfo.getHost(), host);
        Assert.assertEquals(clientInfo.getServiceId(), serviceName);
        Assert.assertEquals(clientInfo.getPort(), port);
        Assert.assertEquals(clientInfo.getMeta(), meta);
        clientInfo.setPort(0);
        clientInfo.setHost(null);
        clientInfo.setServiceId(null);
        clientInfo.setMeta(null);
        REGISTER_CONFIG.setOpenMigration(false);
        REGISTER_CONFIG.setEnableSpringRegister(false);

    }