test_class.declarator: service
test_class.modifier: private
test_class.original_string: private CapabilityMatcherService service;
test_class.type: CapabilityMatcherService
test_class.var_name: service
test_class.declarator: nodeTemplate
test_class.modifier: private
test_class.original_string: private NodeTemplate nodeTemplate;
test_class.type: NodeTemplate
test_class.var_name: nodeTemplate
test_class.declarator: capabilityTypeByTypeName
test_class.modifier: private
test_class.original_string: private Map<String, CapabilityType> capabilityTypeByTypeName;
test_class.type: Map<String, CapabilityType>
test_class.var_name: capabilityTypeByTypeName
test_class.declarator: toscaContextFinder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CapabilityMatcherService.IToscaContextFinder toscaContextFinder;
test_class.type: CapabilityMatcherService.IToscaContextFinder
test_class.var_name: toscaContextFinder
test_class.file: alien4cloud-tosca/src/test/java/alien4cloud/tosca/parser/postprocess/CapabilityMatcherServiceTest.java
test_class.identifier: CapabilityMatcherServiceTest
test_case.body: @Test
      public void capability_should_match_when_type_equals_element_id() throws Exception {
          Map<String, Capability> compatibleCapabilities = service.getCompatibleCapabilityByType(nodeTemplate, "alien.capability.test.MongoEndpoint");
  
          assertThat(compatibleCapabilities).hasSize(1);
          assertThat(compatibleCapabilities).containsKeys("db_endpoint");
      }
test_case.class_method_signature: CapabilityMatcherServiceTest.capability_should_match_when_type_equals_element_id()
test_case.full_signature: @Test public void capability_should_match_when_type_equals_element_id()
test_case.identifier: capability_should_match_when_type_equals_element_id
test_case.invocations: getCompatibleCapabilityByType hasSize assertThat containsKeys assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void capability_should_match_when_type_equals_element_id()
focal_class.declarator: toscaContextFinder
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private IToscaContextFinder toscaContextFinder;
focal_class.type: IToscaContextFinder
focal_class.var_name: toscaContextFinder
focal_class.file: alien4cloud-tosca/src/main/java/alien4cloud/tosca/parser/postprocess/CapabilityMatcherService.java
focal_class.identifier: CapabilityMatcherService
focal_class.interfaces: implements ICapabilityMatcherService
focal_class.class_method_signature: CapabilityMatcherService.CapabilityMatcherService()
focal_class.full_signature: public  CapabilityMatcherService()
focal_class.identifier: CapabilityMatcherService
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  CapabilityMatcherService()
focal_class.class_method_signature: CapabilityMatcherService.getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)
focal_class.full_signature: @Override public Map<String, Capability> getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)
focal_class.identifier: getCompatibleCapabilityByType
focal_class.modifiers: @Override public
focal_class.parameters: (NodeTemplate nodeTemplate, String type)
focal_class.return: Map<String, Capability>
focal_class.signature: Map<String, Capability> getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)
focal_class.class_method_signature: CapabilityMatcherService.getCompatibleCapabilityByType(NodeType nodeType, String type)
focal_class.full_signature: @Override public List<CapabilityDefinition> getCompatibleCapabilityByType(NodeType nodeType, String type)
focal_class.identifier: getCompatibleCapabilityByType
focal_class.modifiers: @Override public
focal_class.parameters: (NodeType nodeType, String type)
focal_class.return: List<CapabilityDefinition>
focal_class.signature: List<CapabilityDefinition> getCompatibleCapabilityByType(NodeType nodeType, String type)
focal_method.body: @Override
      public Map<String, Capability> getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type) {
          Map<String, Capability> capabilities = nodeTemplate.getCapabilities();
          if (capabilities == null) {
              return Collections.emptyMap();
          }
  
          Map<String, Capability> targetCapabilitiesMatch = Maps.newHashMap();
          for (Map.Entry<String, Capability> capabilityEntry : capabilities.entrySet()) {
              String capabilityTypeName = capabilityEntry.getValue().getType();
              CapabilityType capabilityType = toscaContextFinder.find(CapabilityType.class, capabilityTypeName);
  
              if (ToscaTypeUtils.isOfType(capabilityType, type)) {
                  targetCapabilitiesMatch.put(capabilityEntry.getKey(), capabilityEntry.getValue());
              }
          }
          return targetCapabilitiesMatch;
      }
focal_method.class_method_signature: CapabilityMatcherService.getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)
focal_method.full_signature: @Override public Map<String, Capability> getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)
focal_method.identifier: getCompatibleCapabilityByType
focal_method.invocations: getCapabilities emptyMap newHashMap entrySet getType getValue find isOfType put getKey getValue
focal_method.modifiers: @Override public
focal_method.parameters: (NodeTemplate nodeTemplate, String type)
focal_method.return: Map<String, Capability>
focal_method.signature: Map<String, Capability> getCompatibleCapabilityByType(NodeTemplate nodeTemplate, String type)