test_class.declarator: csarRepositorySearchService
test_class.modifier: @Resource
      private
test_class.original_string: @Resource
      private ICSARRepositorySearchService csarRepositorySearchService;
test_class.type: ICSARRepositorySearchService
test_class.var_name: csarRepositorySearchService
test_class.declarator: toscaContextualAspect
test_class.modifier: @Resource
      private
test_class.original_string: @Resource
      private ToscaContextualAspect toscaContextualAspect;
test_class.type: ToscaContextualAspect
test_class.var_name: toscaContextualAspect
test_class.file: alien4cloud-tosca/src/test/java/org/alien4cloud/tosca/utils/NodeTemplateUtilsTest.java
test_class.identifier: NodeTemplateUtilsTest
test_case.body: @Test
      public void getMissingCapabilityByTypeTest() {
          NodeTemplate nodeTemplate = new NodeTemplate();
          Capability nodeCapability = new Capability("org.alien4cloud.capabilities.SampleCapability", null);
          nodeTemplate.setCapabilities(Maps.newHashMap("test", nodeCapability));
          // if the capability derives from parent type then a TOSCA context and query is required to fetch the type.
          CapabilityType capabilityType = new CapabilityType();
          capabilityType.setElementId("org.alien4cloud.capabilities.SampleCapability");
          capabilityType.setDerivedFrom(Lists.newArrayList("org.alien4cloud.capabilities.TestCapability"));
          Mockito.reset(csarRepositorySearchService);
          Mockito.when(csarRepositorySearchService.getElementInDependencies(Mockito.eq(CapabilityType.class),
                  Mockito.eq("org.alien4cloud.capabilities.SampleCapability"), Mockito.any(Set.class))).thenReturn(capabilityType);
  
          Capability capability = toscaContextualAspect.execInToscaContext(() -> getCapabilityByType(nodeTemplate, "org.alien4cloud.capabilities.Unknown"), false,
                  Sets.newHashSet(new CSARDependency("org.alien4cloud.testArchive", "1.0.0-SNAPSHOT")));
          assertNull(capability);
      }
test_case.class_method_signature: NodeTemplateUtilsTest.getMissingCapabilityByTypeTest()
test_case.full_signature: @Test public void getMissingCapabilityByTypeTest()
test_case.identifier: getMissingCapabilityByTypeTest
test_case.invocations: setCapabilities newHashMap setElementId setDerivedFrom newArrayList reset thenReturn when getElementInDependencies eq eq any execInToscaContext getCapabilityByType newHashSet assertNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getMissingCapabilityByTypeTest()
focal_class.file: alien4cloud-tosca/src/main/java/org/alien4cloud/tosca/utils/NodeTemplateUtils.java
focal_class.identifier: NodeTemplateUtils
focal_class.class_method_signature: NodeTemplateUtils.NodeTemplateUtils()
focal_class.full_signature: private  NodeTemplateUtils()
focal_class.identifier: NodeTemplateUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  NodeTemplateUtils()
focal_class.class_method_signature: NodeTemplateUtils.getCapabilitEntryyByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.full_signature: public static Entry<String, Capability> getCapabilitEntryyByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.identifier: getCapabilitEntryyByType
focal_class.modifiers: public static
focal_class.parameters: (NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.return: Entry<String, Capability>
focal_class.signature: Entry<String, Capability> getCapabilitEntryyByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.class_method_signature: NodeTemplateUtils.getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.full_signature: public static Capability getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.identifier: getCapabilityByType
focal_class.modifiers: public static
focal_class.parameters: (NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.return: Capability
focal_class.signature: Capability getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_class.class_method_signature: NodeTemplateUtils.getCapabilityByTypeOrFail(NodeTemplate nodeTemplate, String capabilityType)
focal_class.full_signature: public static Capability getCapabilityByTypeOrFail(NodeTemplate nodeTemplate, String capabilityType)
focal_class.identifier: getCapabilityByTypeOrFail
focal_class.modifiers: public static
focal_class.parameters: (NodeTemplate nodeTemplate, String capabilityType)
focal_class.return: Capability
focal_class.signature: Capability getCapabilityByTypeOrFail(NodeTemplate nodeTemplate, String capabilityType)
focal_class.class_method_signature: NodeTemplateUtils.setCapability(NodeTemplate nodeTemplate, String name, Capability capability)
focal_class.full_signature: public static void setCapability(NodeTemplate nodeTemplate, String name, Capability capability)
focal_class.identifier: setCapability
focal_class.modifiers: public static
focal_class.parameters: (NodeTemplate nodeTemplate, String name, Capability capability)
focal_class.return: void
focal_class.signature: void setCapability(NodeTemplate nodeTemplate, String name, Capability capability)
focal_class.class_method_signature: NodeTemplateUtils.countRelationshipsForRequirement(NodeTemplate nodeTemplate, RequirementDefinition requirementDefinition)
focal_class.full_signature: public static int countRelationshipsForRequirement(NodeTemplate nodeTemplate, RequirementDefinition requirementDefinition)
focal_class.identifier: countRelationshipsForRequirement
focal_class.modifiers: public static
focal_class.parameters: (NodeTemplate nodeTemplate, RequirementDefinition requirementDefinition)
focal_class.return: int
focal_class.signature: int countRelationshipsForRequirement(NodeTemplate nodeTemplate, RequirementDefinition requirementDefinition)
focal_method.body: public static Capability getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName) {
          Entry<String, Capability> capabilityEntry = getCapabilitEntryyByType(nodeTemplate, capabilityTypeName);
          return capabilityEntry == null ? null : capabilityEntry.getValue();
      }
focal_method.class_method_signature: NodeTemplateUtils.getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_method.full_signature: public static Capability getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)
focal_method.identifier: getCapabilityByType
focal_method.invocations: getCapabilitEntryyByType getValue
focal_method.modifiers: public static
focal_method.parameters: (NodeTemplate nodeTemplate, String capabilityTypeName)
focal_method.return: Capability
focal_method.signature: Capability getCapabilityByType(NodeTemplate nodeTemplate, String capabilityTypeName)