### Question:
ToscaResourceInstaller { @Transactional(rollbackFor = {ArtifactInstallerException.class}) public void installTheResource(ToscaResourceStructure toscaResourceStruct, ResourceStructure resourceStruct) throws ArtifactInstallerException { if (resourceStruct instanceof VfResourceStructure) { installTheVfResource(toscaResourceStruct, (VfResourceStructure) resourceStruct); } else if (resourceStruct instanceof PnfResourceStructure) { installPnfResource(toscaResourceStruct, (PnfResourceStructure) resourceStruct); } else { logger.warn("Unrecognized resource type"); } }  boolean isCsarAlreadyDeployed(ToscaResourceStructure toscaResourceStructure); boolean isResourceAlreadyDeployed(ResourceStructure vfResourceStruct, boolean serviceDeployed); void installTheComponentStatus(IStatusData iStatus); @Transactional(rollbackFor = {ArtifactInstallerException.class}) void installTheResource(ToscaResourceStructure toscaResourceStruct, ResourceStructure resourceStruct); @Transactional(rollbackFor = {ArtifactInstallerException.class}) void installTheVfResource(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStruct); void processWatchdog(String distributionId, String servideUUID, Optional<String> distributionNotification,
            String consumerId); String verifyTheFilePrefixInArtifacts(String filebody, VfResourceStructure vfResourceStructure,
            List<String> listTypes); String verifyTheFilePrefixInString(final String body, final String filenameToVerify); String getVnfcResourceInput(IEntityDetails vfcEntity, List<Input> inputList); List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct,
            EntityQueryBuilder entityType, TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch); String getLeafPropertyValue(IEntityDetails entityDetails, String propName); @Transactional(rollbackFor = {ArtifactInstallerException.class}) void installNsstService(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStruct,
            String artifactContent);  }### Answer:
@Test public void installTheResourceWithGroupAndVFModulesTest() throws Exception { ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller(); ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(true, toscaInstaller); toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct); assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully()); }
@Test public void installTheResourceGroupWithoutVFModulesTest() throws Exception { ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller(); ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(false, toscaInstaller); toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct); assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully()); }
@Test public void installTheResourceExceptionTest() throws Exception { expectedException.expect(ArtifactInstallerException.class); notificationData.setDistributionID("testStatusFailureTosca"); notificationData.setServiceVersion("123456"); notificationData.setServiceUUID("serviceUUID"); notificationData.setWorkloadContext("workloadContext"); doReturn(notificationData).when(vfResourceStructure).getNotification(); doReturn(resourceInstance).when(vfResourceStructure).getResourceInstance(); toscaInstaller.installTheResource(toscaResourceStruct, vfResourceStructure); }
@Test public void installTheResourceDBExceptionTest() throws Exception { notificationData.setDistributionID("testStatusSuccessTosca"); notificationData.setServiceVersion("123456"); notificationData.setServiceUUID("serviceUUID"); notificationData.setWorkloadContext("workloadContext"); doReturn(notificationData).when(vfResourceStructure).getNotification(); doReturn(resourceInstance).when(vfResourceStructure).getResourceInstance(); doThrow(LockAcquisitionException.class).when(toscaResourceStruct).getToscaArtifact(); toscaInstaller.installTheResource(toscaResourceStruct, vfResourceStructure); }