@Test
public void shouldDecorateWorkflowInstanceResources() {

  Workflow workflow = workflowUsingResources(WORKFLOW_ID1, "foo", "bar");
  when(resourceDecorator.decorateResources(
      any(RunState.class), any(WorkflowConfiguration.class), anySet()))
      .thenReturn(ImmutableSet.of("baz", "quux", "GLOBAL_STYX_CLUSTER"));
  when(config.globalConcurrency()).thenReturn(Optional.of(17L));
  setResourceLimit("baz", 4);
  setResourceLimit("quux", 4);
  initWorkflow(workflow);
  populateActiveStates(RunState.create(INSTANCE_1, State.QUEUED, time.get()));
  scheduler.tick();
  verify(resourceDecorator).decorateResources(any(RunState.class), eq(workflow.configuration()),
      eq(ImmutableSet.of("foo", "bar", "GLOBAL_STYX_CLUSTER")));
  verify(stateManager).receiveIgnoreClosed(eq(Event.dequeue(INSTANCE_1,
      ImmutableSet.of("baz", "quux", "GLOBAL_STYX_CLUSTER"))), anyLong());
}