test_class.file: org.eclipse.winery.repository/src/test/java/org/eclipse/winery/repository/driverspecificationandinjection/DriverInjectionTest.java
test_class.identifier: DriverInjectionTest
test_class.superclass: extends TestWithGitBackedRepository
test_case.body: @Test
      public void setDriverProperty() throws Exception {
          setRevisionTo("d8ee55deecf37f5052d27807df691a7b70ec50f2");
          ServiceTemplateId id = new ServiceTemplateId("http://winery.opentosca.org/test/servicetemplates/ponyuniverse/daspecifier", "DASpecificationTest", false);
          TTopologyTemplate topologyTemplate = this.repository.getElement(id).getTopologyTemplate();
          TRelationshipTemplate relationshipTemplate = topologyTemplate.getRelationshipTemplate("con_71");
          TDeploymentArtifact deploymentArtifact = topologyTemplate.getNodeTemplate("dressageequipment").getDeploymentArtifacts().getDeploymentArtifact().stream()
              .filter(da -> da.getName().equalsIgnoreCase("DressageEquipment_Pony")).findFirst().get();
  
          DriverInjection.setDriverProperty(relationshipTemplate, deploymentArtifact);
  
          assertEquals("org.test.dressagedriver", ModelUtilities.getPropertiesKV(relationshipTemplate).get("Driver"));
  
      }
test_case.class_method_signature: DriverInjectionTest.setDriverProperty()
test_case.full_signature: @Test public void setDriverProperty()
test_case.identifier: setDriverProperty
test_case.invocations: setRevisionTo getTopologyTemplate getElement getRelationshipTemplate get findFirst filter stream getDeploymentArtifact getDeploymentArtifacts getNodeTemplate equalsIgnoreCase getName setDriverProperty assertEquals get getPropertiesKV
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void setDriverProperty()
focal_class.file: org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/driverspecificationandinjection/DriverInjection.java
focal_class.identifier: DriverInjection
focal_class.class_method_signature: DriverInjection.injectDriver(TTopologyTemplate topologyTemplate)
focal_class.full_signature: public static TTopologyTemplate injectDriver(TTopologyTemplate topologyTemplate)
focal_class.identifier: injectDriver
focal_class.modifiers: public static
focal_class.parameters: (TTopologyTemplate topologyTemplate)
focal_class.return: TTopologyTemplate
focal_class.signature: TTopologyTemplate injectDriver(TTopologyTemplate topologyTemplate)
focal_class.class_method_signature: DriverInjection.setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_class.full_signature: public static void setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_class.identifier: setDriverProperty
focal_class.modifiers: public static
focal_class.parameters: (TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_class.return: void
focal_class.signature: void setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_method.body: public static void setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact) throws Exception {
          QName DAArtifactTemplateQName = driverDeploymentArtifact.getArtifactRef();
          ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId(DAArtifactTemplateQName);
          TArtifactTemplate artifactTemplate = RepositoryFactory.getRepository().getElement(artifactTemplateId);
  
          Map<String, String> artifactProperties = ModelUtilities.getPropertiesKV(artifactTemplate);
          Map<String, String> relationshipProperties = ModelUtilities.getPropertiesKV(relationshipTemplate);
  
          if ((artifactProperties != null) && (relationshipProperties != null) && artifactProperties.containsKey("Driver") && relationshipProperties.containsKey("Driver")) {
              relationshipProperties.put("Driver", artifactProperties.get("Driver"));
              relationshipTemplate.getProperties().setKVProperties(relationshipProperties);
          } else {
              throw new WineryRepositoryException("No Property found to set to the driver classname");
          }
      }
focal_method.class_method_signature: DriverInjection.setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_method.full_signature: public static void setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_method.identifier: setDriverProperty
focal_method.invocations: getArtifactRef getElement getRepository getPropertiesKV getPropertiesKV containsKey containsKey put get setKVProperties getProperties
focal_method.modifiers: public static
focal_method.parameters: (TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)
focal_method.return: void
focal_method.signature: void setDriverProperty(TRelationshipTemplate relationshipTemplate, TDeploymentArtifact driverDeploymentArtifact)