Ejemplo n.º 1
0
 /**
  * This test is to get unit test coverage for the rest method. Real unit tests are covered in
  * Service layer EmrServiceTest.
  */
 @Test
 public void testGetEmrOozieWorkflow() throws Exception {
   try {
     emrRestController.getEmrOozieWorkflow(
         NAMESPACE_CD,
         EMR_CLUSTER_DEFINITION_NAME,
         EMR_CLUSTER_NAME,
         "test_oozieWorkflowJobId",
         false);
     fail("Should throw an ObjectNotFoundException.");
   } catch (ObjectNotFoundException ex) {
     assertEquals("Namespace \"" + NAMESPACE_CD + "\" doesn't exist.", ex.getMessage());
   }
 }
Ejemplo n.º 2
0
  /**
   * This test is to get unit test coverage for the rest method. Real unit tests are covered in
   * Service layer EmrServiceTest.
   */
  @Test
  public void testRunOozieJob() throws Exception {
    // Create a RunOozieWorkflowRequest entry to pass it to RestController
    RunOozieWorkflowRequest runOozieWorkflowRequest =
        new RunOozieWorkflowRequest(
            NAMESPACE_CD,
            EMR_CLUSTER_DEFINITION_NAME,
            "test_cluster",
            OOZIE_WORKFLOW_LOCATION,
            null);

    try {
      emrRestController.runOozieJobToEmrCluster(runOozieWorkflowRequest);
      fail("Should throw an ObjectNotFoundException.");
    } catch (ObjectNotFoundException ex) {
      assertEquals("Namespace \"" + NAMESPACE_CD + "\" doesn't exist.", ex.getMessage());
    }
  }