### Question:
ToscaResourceInstaller { public void installTheComponentStatus(IStatusData iStatus) throws ArtifactInstallerException { logger.debug("Entering installTheComponentStatus for distributionId {} and ComponentName {}", iStatus.getDistributionID(), iStatus.getComponentName()); try { WatchdogComponentDistributionStatus cdStatus = new WatchdogComponentDistributionStatus(iStatus.getDistributionID(), iStatus.getComponentName()); cdStatus.setComponentDistributionStatus(iStatus.getStatus().toString()); watchdogCDStatusRepository.save(cdStatus); } catch (Exception e) { logger.debug("Exception caught in installTheComponentStatus {}", e.getMessage()); throw new ArtifactInstallerException("Exception caught in installTheComponentStatus " + e.getMessage()); } }  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 installTheComponentStatusTest() throws Exception { String distributionId = "testStatusSuccessTosca"; String componentName = "testComponentName"; statusData = spy(JsonStatusData.class); doReturn(distributionId).when(statusData).getDistributionID(); doReturn(componentName).when(statusData).getComponentName(); WatchdogComponentDistributionStatus expectedWatchdogComponentDistributionStatus = new WatchdogComponentDistributionStatus(distributionId, componentName); expectedWatchdogComponentDistributionStatus.setComponentDistributionStatus(statusData.getStatus().toString()); WatchdogComponentDistributionStatus cdStatus = new WatchdogComponentDistributionStatus(statusData.getDistributionID(), statusData.getComponentName()); toscaInstaller.installTheComponentStatus(statusData); WatchdogComponentDistributionStatus actualWatchdogComponentDistributionStatus = getWatchdogCDStatusWithName(watchdogCDStatusRepository.findByDistributionId("testStatusSuccessTosca"), statusData.getComponentName()); assertEquals(statusData.getDistributionID(), cdStatus.getDistributionId()); assertEquals(statusData.getComponentName(), cdStatus.getComponentName()); assertThat(actualWatchdogComponentDistributionStatus, sameBeanAs(expectedWatchdogComponentDistributionStatus).ignoring("createTime").ignoring("modifyTime")); }
@Test public void installTheComponentStatusExceptionTest() throws ArtifactInstallerException { expectedException.expect(ArtifactInstallerException.class); statusData = spy(JsonStatusData.class); doReturn(null).when(statusData).getStatus(); toscaInstaller.installTheComponentStatus(statusData); }