@Test
public void testGetActiveStatesForMultiComponent() throws Exception {

  sinceVersion(Api.Version.V3);
  storage.writeActiveState(WFI_1, PERSISTENT_STATE_1);
  storage.writeActiveState(WFI_2, PERSISTENT_STATE_2);
  storage.writeActiveState(WFI_3, PERSISTENT_STATE_3);
  storage.writeActiveState(WFI_4, PERSISTENT_STATE_4);
  assertThat(storage.readActiveStates().entrySet(), hasSize(4));
  Response<ByteString> response =
      awaitResponse(serviceHelper.request("GET",
          path("/activeStates?components=" + C_ID_1 + "," + C_ID_3 + "," + C_ID_1)));
  assertThat(response, hasStatus(withCode(Status.OK)));
  String json = response.payload().orElseThrow().utf8();
  RunStateDataPayload
      parsed = Json.OBJECT_MAPPER.readValue(json, RunStateDataPayload.class);
  assertThat(parsed.activeStates(), hasSize(3));
  var activeStates = ApiTestUtil.groupStatesByWorkflow(parsed.activeStates());
  assertThat(activeStates.get(WorkflowId.create(C_ID_1, WF_ID_1)).size(), is(1));
  assertThat(activeStates.get(WorkflowId.create(C_ID_1, WF_ID_2)).size(), is(1));
  assertThat(activeStates.get(WorkflowId.create(C_ID_3, WF_ID_1)).size(), is(1));
}