test_class.declarator: IMAGE_RESOURCE_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST.json")
test_class.modifier: private static final
test_class.original_string: private static final String IMAGE_RESOURCE_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST.json");
test_class.type: String
test_class.var_name: IMAGE_RESOURCE_FILE
test_class.declarator: INVALID_VERSION_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_invalid_version.json")
test_class.modifier: private static final
test_class.original_string: private static final String INVALID_VERSION_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_invalid_version.json");
test_class.type: String
test_class.var_name: INVALID_VERSION_FILE
test_class.declarator: MISSING_SOL_LIST_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_list.json")
test_class.modifier: private static final
test_class.original_string: private static final String MISSING_SOL_LIST_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_list.json");
test_class.type: String
test_class.var_name: MISSING_SOL_LIST_FILE
test_class.declarator: MISSING_SOL_ID_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_id.json")
test_class.modifier: private static final
test_class.original_string: private static final String MISSING_SOL_ID_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_id.json");
test_class.type: String
test_class.var_name: MISSING_SOL_ID_FILE
test_class.declarator: MISSING_SOL_URL_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_url.json")
test_class.modifier: private static final
test_class.original_string: private static final String MISSING_SOL_URL_FILE = WorkerTestUtils.getPath("IMAGE_MANIFEST_missing_sol_url.json");
test_class.type: String
test_class.var_name: MISSING_SOL_URL_FILE
test_class.declarator: EXPECTED_MAP
test_class.modifier: private static final
test_class.original_string: private static final Map<Integer, String> EXPECTED_MAP;
test_class.type: Map<Integer, String>
test_class.var_name: EXPECTED_MAP
test_class.declarator: expectedEx = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedEx = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedEx
test_class.file: ingester/src/test/java/com/amazonaws/services/dynamodbv2/json/demo/mars/worker/DynamoDBMissionWorkerTest.java
test_class.identifier: DynamoDBMissionWorkerTest
test_case.body: @Test
      public void testMissingSolID() {
          final Logger logger = Logger.getLogger(DynamoDBMissionWorker.class.getName());
          Handler handler;
          final ByteArrayOutputStream os = new ByteArrayOutputStream();
          final URL url = PowerMock.createMock(URL.class);
          PowerMock.mockStatic(JSONUtils.class);
          PowerMock.mockStatic(NetworkUtils.class);
          String manifest = null;
          try {
              manifest = WorkerTestUtils.readFile(MISSING_SOL_ID_FILE);
          } catch (final IOException e) {
              fail("Could not read file: " + MISSING_SOL_ID_FILE);
          }
          try {
              NetworkUtils.getDataFromURL(url, null, ImageIngester.DEFAULT_CONNECT_TIMEOUT);
              PowerMock.expectLastCall().andReturn(manifest.getBytes());
              PowerMock.replayAll();
              handler = new StreamHandler(os, new SimpleFormatter());
              logger.setUseParentHandlers(false);
              logger.addHandler(handler);
              DynamoDBMissionWorker.getSolJSON(url, ImageIngester.DEFAULT_CONNECT_TIMEOUT);
              handler.flush();
              assertTrue(os.toString().contains("WARNING: Sol missing required keys"));
          } catch (final IOException e) {
              fail(e.getMessage());
          } finally {
              try {
                  os.close();
              } catch (final IOException e) {
                  fail(e.getMessage());
              }
          }
      }
test_case.class_method_signature: DynamoDBMissionWorkerTest.testMissingSolID()
test_case.full_signature: @Test public void testMissingSolID()
test_case.identifier: testMissingSolID
test_case.invocations: getLogger getName createMock mockStatic mockStatic readFile fail getDataFromURL andReturn expectLastCall getBytes replayAll setUseParentHandlers addHandler getSolJSON flush assertTrue contains toString fail getMessage close fail getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMissingSolID()
focal_class.declarator: LOGGER = Logger.getLogger(DynamoDBMissionWorker.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(DynamoDBMissionWorker.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: RESOURCE_TYPE_KEY = "type"
focal_class.modifier: private static final
focal_class.original_string: private static final String RESOURCE_TYPE_KEY = "type";
focal_class.type: String
focal_class.var_name: RESOURCE_TYPE_KEY
focal_class.declarator: SUPPORTED_TYPES = Arrays.asList("mer-images-manifest-1.0",
          "msl-images-manifest-2.0")
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> SUPPORTED_TYPES = Arrays.asList("mer-images-manifest-1.0",
          "msl-images-manifest-2.0");
focal_class.type: List<String>
focal_class.var_name: SUPPORTED_TYPES
focal_class.declarator: SOLS_LIST_KEY = "sols"
focal_class.modifier: private static final
focal_class.original_string: private static final String SOLS_LIST_KEY = "sols";
focal_class.type: String
focal_class.var_name: SOLS_LIST_KEY
focal_class.declarator: SOL_ID_KEY = "sol"
focal_class.modifier: private static final
focal_class.original_string: private static final String SOL_ID_KEY = "sol";
focal_class.type: String
focal_class.var_name: SOL_ID_KEY
focal_class.declarator: SOL_URL_KEY = "url"
focal_class.modifier: private static final
focal_class.original_string: private static final String SOL_URL_KEY = "url";
focal_class.type: String
focal_class.var_name: SOL_URL_KEY
focal_class.declarator: manifestURL
focal_class.modifier: private final
focal_class.original_string: private final String manifestURL;
focal_class.type: String
focal_class.var_name: manifestURL
focal_class.declarator: connectTimeout
focal_class.modifier: private final
focal_class.original_string: private final int connectTimeout;
focal_class.type: int
focal_class.var_name: connectTimeout
focal_class.file: ingester/src/main/java/com/amazonaws/services/dynamodbv2/json/demo/mars/worker/DynamoDBMissionWorker.java
focal_class.identifier: DynamoDBMissionWorker
focal_class.interfaces: implements Callable<Map<Integer, String>>
focal_class.class_method_signature: DynamoDBMissionWorker.getSolJSON(final URL url, final int connectTimeout)
focal_class.full_signature: public static Map<Integer, String> getSolJSON(final URL url, final int connectTimeout)
focal_class.identifier: getSolJSON
focal_class.modifiers: public static
focal_class.parameters: (final URL url, final int connectTimeout)
focal_class.return: Map<Integer, String>
focal_class.signature: Map<Integer, String> getSolJSON(final URL url, final int connectTimeout)
focal_class.class_method_signature: DynamoDBMissionWorker.DynamoDBMissionWorker(final String manifestURL, final int connectTimeout)
focal_class.full_signature: public  DynamoDBMissionWorker(final String manifestURL, final int connectTimeout)
focal_class.identifier: DynamoDBMissionWorker
focal_class.modifiers: public
focal_class.parameters: (final String manifestURL, final int connectTimeout)
focal_class.signature:  DynamoDBMissionWorker(final String manifestURL, final int connectTimeout)
focal_class.class_method_signature: DynamoDBMissionWorker.call()
focal_class.full_signature: @Override public Map<Integer, String> call()
focal_class.identifier: call
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Integer, String>
focal_class.signature: Map<Integer, String> call()
focal_method.body: 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;
      }
focal_method.class_method_signature: DynamoDBMissionWorker.getSolJSON(final URL url, final int connectTimeout)
focal_method.full_signature: public static Map<Integer, String> getSolJSON(final URL url, final int connectTimeout)
focal_method.identifier: getSolJSON
focal_method.invocations: getJSONFromURL has contains asText get has get size path has has asInt get asText get put warning warning
focal_method.modifiers: public static
focal_method.parameters: (final URL url, final int connectTimeout)
focal_method.return: Map<Integer, String>
focal_method.signature: Map<Integer, String> getSolJSON(final URL url, final int connectTimeout)