@Override
    public void createApiConfig(KubevirtApiConfig config) {
        checkNotNull(config, ERR_NULL_CONFIG);
        checkArgument(configStore.apiConfigs().size() == 0, ERR_UNIQUE_CONFIG);

        KubevirtApiConfig newConfig = config;
        if (config.apiServerFqdn() != null) {
            IpAddress apiServerIp = resolveHostname(config.apiServerFqdn());
            if (apiServerIp != null) {
                newConfig = config.updateIpAddress(apiServerIp);
                newConfig = newConfig.updatePort(API_SERVER_PORT);
            } else {
                log.warn("API server IP is not resolved for host {}", config.apiServerFqdn());
            }
        }

        configStore.createApiConfig(newConfig);
        log.info(String.format(MSG_CONFIG, endpoint(newConfig), MSG_CREATED));
    }
@Test(expected = IllegalArgumentException.class)
    public void testConfigUniqueness() {
        target.createApiConfig(apiConfig1);
        target.createApiConfig(apiConfig2);
        validateEvents(KUBEVIRT_API_CONFIG_CREATED);
    }