class DynamoDBMissionWorker implements Callable<Map<Integer, String>> {

    public static Map<Integer, String> getSolJSON(final URL url, final int connectTimeout) throws IOException {
        final Map<Integer, String> map = new HashMap<Integer, String>();
        // Retrieve the JSON data
        final JsonNode manifest = JSONParser.getJSONFromURL(url, connectTimeout);
        // Validate the JSON data version
        if (!manifest.has(RESOURCE_TYPE_KEY) || !SUPPORTED_TYPES.contains(manifest.get(RESOURCE_TYPE_KEY).asText())) {
            throw new IllegalArgumentException("Manifest version verification failed");
        }
        // Validate that the JSON data contains a sol list
        if (!manifest.has(SOLS_LIST_KEY)) {
            throw new IllegalArgumentException("Manifest does not contain a sol list");
        }
        final ArrayNode sols = (ArrayNode) manifest.get(SOLS_LIST_KEY);
        // Process each sol in the sol list
        for (int i = 0; i < sols.size(); i++) {
            final JsonNode sol = sols.path(i);
            if (sol.has(SOL_ID_KEY) && sol.has(SOL_URL_KEY)) {
                final Integer solID = sol.get(SOL_ID_KEY).asInt();
                final String solURL = sol.get(SOL_URL_KEY).asText();
                if (solID != null && solURL != null) {
                    // Add valid sol to the map
                    map.put(solID, solURL);
                } else {
                    LOGGER.warning("Sol contains unexpected values: " + sol);
                }
            } else {
                LOGGER.warning("Sol missing required keys: ");
            }
        }
        return map;
    }

}

class DynamoDBMissionWorkerTest {

    private static final String IMAGE_RESOURCE_FILE;
    private static final String INVALID_VERSION_FILE;
    private static final String MISSING_SOL_LIST_FILE;
    private static final String MISSING_SOL_ID_FILE;
    private static final String MISSING_SOL_URL_FILE;
    private static final Map<Integer, String> EXPECTED_MAP;
    @Rule
    public ExpectedException expectedEx;

    @Test
    public void testInvalidVersion() {

        expectedEx.expect(IllegalArgumentException.class);
        expectedEx.expectMessage("version verification failed");
        final URL url = PowerMock.createMock(URL.class);
        PowerMock.mockStatic(JSONUtils.class);
        PowerMock.mockStatic(NetworkUtils.class);
        String manifest = null;
        try {
            manifest = WorkerTestUtils.readFile(INVALID_VERSION_FILE);
        } catch (final IOException e) {
            fail("Could not read file: " + INVALID_VERSION_FILE);
        }
        try {
            NetworkUtils.getDataFromURL(url, null, ImageIngester.DEFAULT_CONNECT_TIMEOUT);
            PowerMock.expectLastCall().andReturn(manifest.getBytes());
            PowerMock.replayAll();
            DynamoDBMissionWorker.getSolJSON(url, ImageIngester.DEFAULT_CONNECT_TIMEOUT);
        } catch (final IOException e) {
            fail(e.getMessage());
        }
        fail("Version is incorrect");
    }

}