@Test
public void testCreateDryRun() throws Exception {

  Authentication authentication = TestAuthenticationFactory.createAdministrator();
  SecurityContextHolder.getContext().setAuthentication(authentication);
  File file = new File("src/test/resources/version_definition_resource_provider.xml");
  final ResourceProvider versionProvider = new VersionDefinitionResourceProvider();
  final Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
  final Map<String, Object> properties = new LinkedHashMap<String, Object>();
  properties.put(VersionDefinitionResourceProvider.VERSION_DEF_DEFINITION_URL,
      file.toURI().toURL().toString());
  propertySet.add(properties);
  Map<String, String> info = Collections.singletonMap(Request.DIRECTIVE_DRY_RUN, "true");
  final Request createRequest = PropertyHelper.getCreateRequest(propertySet, info);
  RequestStatus status = versionProvider.createResources(createRequest);
  Assert.assertEquals(1, status.getAssociatedResources().size());
  Resource res = status.getAssociatedResources().iterator().next();
  // because we aren't using subresources, but return subresource-like properties, the key is an empty string
  Assert.assertTrue(res.getPropertiesMap().containsKey(""));
  Map<String, Object> resMap = res.getPropertiesMap().get("");
  Assert.assertTrue(resMap.containsKey("operating_systems"));
  Assert.assertTrue(res.getPropertiesMap().containsKey("VersionDefinition"));
  Assert.assertEquals("2.2.0.8-5678", res.getPropertyValue("VersionDefinition/repository_version"));
  Assert.assertNull(res.getPropertyValue("VersionDefinition/show_available"));
  Request getRequest = PropertyHelper.getReadRequest("VersionDefinition");
  Set<Resource> results = versionProvider.getResources(getRequest, null);
  Assert.assertEquals(0, results.size());
}