@Test
  public void testGetPacklets() throws Exception {
    Long mpackId = new Long(100);
    ArrayList<Module> packletArrayList = new ArrayList<>();
    Module samplePacklet = new Module();
    Injector injector = createNiceMock(Injector.class);
    //samplePacklet.setType(Packlet.PackletType.SERVICE_PACKLET);
    samplePacklet.setVersion("3.0.0");
    samplePacklet.setName("NIFI");
    samplePacklet.setDefinition("nifi.tar.gz");
    packletArrayList.add(samplePacklet);
    expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null).atLeastOnce();
    expect(ambariMetaInfo.getModules(mpackId)).andReturn(packletArrayList).atLeastOnce();
    replay(ambariMetaInfo,injector);
    AmbariManagementController controller = new AmbariManagementControllerImpl(null, clusters, injector);
    setAmbariMetaInfo(ambariMetaInfo, controller);

    Assert.assertEquals(packletArrayList,controller.getModules(mpackId));

  }
Ensure that RollbackException is thrown outside the updateClusters method
when a unique constraint violation occurs.
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java