public ElasticAgentInformation getElasticAgentInformationFromResponseBody(String responseBody) {
        final ElasticAgentInformationDTO elasticAgentInformationDTO = FORCED_EXPOSE_GSON.fromJson(responseBody, ElasticAgentInformationDTO.class);
        return elasticAgentInformationConverterV5.fromDTO(elasticAgentInformationDTO);
    }
@Test
    public void shouldGetTheElasticAgentInformationFromResponseBodyOfMigrateCall() throws CryptoException {
        String responseBody = "{" +
                "    \"plugin_settings\":{" +
                "        \"key2\":\"password\", " +
                "        \"key\":\"value\"" +
                "    }," +
                "    \"cluster_profiles\":[" +
                "        {" +
                "            \"id\":\"cluster_profile_id\"," +
                "            \"plugin_id\":\"plugin_id\"," +
                "            \"properties\":{" +
                "                \"some_key\":\"some_value\", " +
                "                \"some_key2\":\"some_value2\"" +
                "            }" +
                "         }" +
                "    ]," +
                "    \"elastic_agent_profiles\":[" +
                "        {" +
                "            \"id\":\"profile_id\"," +
                "            \"plugin_id\":\"plugin_id\"," +
                "            \"cluster_profile_id\":\"cluster_profile_id\"," +
                "            \"properties\":{" +
                "                \"some_key\":\"some_value\"," +
                "                \"some_key2\":\"some_value2\"" +
                "            }" +
                "        }" +
                "    ]" +
                "}\n";

        ElasticAgentMetadataStore store = ElasticAgentMetadataStore.instance();
        PluggableInstanceSettings elasticAgentProfileSettings = new PluggableInstanceSettings(List.of(new PluginConfiguration("some_key", new Metadata(true, true))));
        PluggableInstanceSettings clusterProfileSettings = new PluggableInstanceSettings(List.of(new PluginConfiguration("some_key2", new Metadata(true, true))));
        store.setPluginInfo(new ElasticAgentPluginInfo(pluginDescriptor("plugin_id"), elasticAgentProfileSettings, clusterProfileSettings, null, null, null));

        ElasticAgentInformation elasticAgentInformation = new ElasticAgentExtensionConverterV5().getElasticAgentInformationFromResponseBody(responseBody);

        ConfigurationProperty property1 = new ConfigurationProperty(new ConfigurationKey("key"), new ConfigurationValue("value"));
        ConfigurationProperty property2 = new ConfigurationProperty(new ConfigurationKey("key2"), new EncryptedConfigurationValue(new GoCipher().encrypt("password")));
        Configuration configuration = new Configuration();
        configuration.add(property1);
        configuration.add(property2);

        Map<String, String> pluginSettings = configuration.getConfigurationAsMap(true);

        List<ClusterProfile> clusterProfiles = new ArrayList<>();
        clusterProfiles.add(new ClusterProfile("cluster_profile_id", "plugin_id", new ConfigurationProperty(new ConfigurationKey("some_key"), new ConfigurationValue("some_value")), new ConfigurationProperty(new ConfigurationKey("some_key2"), new EncryptedConfigurationValue(new GoCipher().encrypt("some_value2")))));

        List<ElasticProfile> elasticAgentProfiles = new ArrayList<>();
        //do not worry about encryption, it is handled during config save (migrate-config) call
        elasticAgentProfiles.add(new ElasticProfile("profile_id", "cluster_profile_id", new ConfigurationProperty(new ConfigurationKey("some_key"), new ConfigurationValue("some_value")), new ConfigurationProperty(new ConfigurationKey("some_key2"), new ConfigurationValue("some_value2"))));

        ElasticAgentInformation expectedElasticAgentInformation = new ElasticAgentInformation(pluginSettings, clusterProfiles, elasticAgentProfiles);

        assertThat(elasticAgentInformation, is(expectedElasticAgentInformation));
    }