@Test
public void snapshotsInDependenciesManagement() throws Exception {
File pomFile = getResourceAsFile("/poms/snapshots/pom-snapshots-in-dep-management.xml");
Map<ModuleName, String> modules = Maps.newHashMap();
modules.put(new ModuleName("org.jfrog.test.nested", "nested1"), "3.6");
modules.put(new ModuleName("org.jfrog.test.nested", "nested2"), "3.6");
modules.put(new ModuleName("org.jfrog.test.nested", "four"), "3.6");
try {
new PomTransformer(new ModuleName("org.jfrog.test.nested", "four"), modules, "", true).transform(pomFile);
fail("Pom contains snapshot in the dependency management and should fail");
} catch (SnapshotNotAllowedException e) {
String message = e.getMessage();
assertTrue(message.contains("org.jfrog.test.nested:nestedX:2.0-SNAPSHOT"),
"Unexpected error message: " + message);