Repository: ambari Updated Branches: refs/heads/trunk 03784ecad -> 1dfe7fd93
AMBARI-7734 - Alerts: Create REST API Endpoint for Alert History (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1dfe7fd9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1dfe7fd9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1dfe7fd9 Branch: refs/heads/trunk Commit: 1dfe7fd93a5800a95baf8939f291b1208cabe18e Parents: 03784ec Author: Jonathan Hurley <[email protected]> Authored: Fri Oct 10 13:56:15 2014 -0400 Committer: Jonathan Hurley <[email protected]> Committed: Sun Oct 12 20:59:11 2014 -0400 ---------------------------------------------------------------------- .../server/controller/AmbariManagementControllerTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1dfe7fd9/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java index 96ebac3..c9c8258 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java @@ -33,7 +33,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -8233,10 +8232,10 @@ public class AmbariManagementControllerTest { @Test public void testUpdateRepoUrlController() throws Exception { + String badUrl = "http://hortonworks.com"; RepositoryInfo repo = ambariMetaInfo.getRepository(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID); - RepositoryRequest request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID); - request.setBaseUrl("http://hortonworks.com"); + request.setBaseUrl(badUrl); Set<RepositoryRequest> requests = new HashSet<RepositoryRequest>(); requests.add(request); @@ -8244,9 +8243,10 @@ public class AmbariManagementControllerTest { // test bad url try { controller.updateRespositories(requests); + Assert.fail("Expected a bad URL to throw an exception"); } catch (Exception e) { assertNotNull(e); - Assert.assertTrue(e.getMessage().contains(FileNotFoundException.class.getName())); + Assert.assertTrue(e.getMessage().contains(badUrl)); } // test bad url, but allow to set anyway request.setVerifyBaseUrl(false);
