@Test
public void testCreateResources_checkRequestId() throws Exception {

  Map<Resource.Type, String> keyPropertyIds = Collections.emptyMap();
  Set<String> propertyIds = Collections.singleton(ValidationResourceProvider.VALIDATION_ID_PROPERTY_ID);
  AmbariManagementController ambariManagementController = mock(AmbariManagementController.class);
  ValidationResourceProvider provider = spy(new ValidationResourceProvider(propertyIds,
      keyPropertyIds, ambariManagementController));
  StackAdvisorRequest stackAdvisorRequest = mock(StackAdvisorRequest.class);
  Request request = mock(Request.class);
  doReturn(stackAdvisorRequest).when(provider).prepareStackAdvisorRequest(request);
  StackAdvisorHelper saHelper = mock(StackAdvisorHelper.class);
  ValidationResponse response = mock(ValidationResponse.class);
  Version version = mock(Version.class);
  doReturn(3).when(response).getId();
  doReturn(version).when(response).getVersion();
  doReturn(response).when(saHelper).validate(any(StackAdvisorRequest.class));
  ValidationResourceProvider.init(saHelper);
  RequestStatus status = provider.createResources(request);
  Set<Resource> associatedResources = status.getAssociatedResources();
  assertNotNull(associatedResources);
  assertEquals(1, associatedResources.size());
  Resource resource = associatedResources.iterator().next();
  Object requestId = resource.getPropertyValue(ValidationResourceProvider.VALIDATION_ID_PROPERTY_ID);
  assertNotNull(requestId);
  assertEquals(3, requestId);
}