@Test
public void injectRelationshipTemplatePropertiesAsInputs() throws Exception {

    Map<String, PaaSNodeTemplate> nodes = Maps.newHashMap();
    PaaSNodeTemplate source = buildPaaSNodeTemplate();
    nodes.put(node1, source);
    PaaSNodeTemplate target = buildPaaSNodeTemplate();
    nodes.put(node2, target);
    PaaSRelationshipTemplate paaSRelationshipTemplate = buildFakePaaSRelTemplate(node1, node2, fakeCapa1);
    Mockito.when(source.getRelationshipTemplates()).thenReturn(Lists.newArrayList(paaSRelationshipTemplate));
    PaaSUtils.processRelationshipTemplateProperties(paaSRelationshipTemplate, nodes);
    Operation operation = paaSRelationshipTemplate.getInterfaces().get(interface1).getOperations().get(operation1);
    Assert.assertNotNull(operation.getInputParameters());
    // assert all relationship properties are inputs properties
    Assert.assertTrue(operation.getInputParameters().containsKey(SELF + fake1));
    Assert.assertTrue(operation.getInputParameters().containsKey(SELF + fake3));
    Assert.assertTrue(operation.getInputParameters().containsKey(SELF + fake5));
    Assert.assertTrue(operation.getInputParameters().containsKey(SELF + fake2));
    // assert that the property from the operation has not been overrided
    Assert.assertEquals(operation.getInputParameters().get(fake1), new ScalarPropertyValue("1_from_operation"));
    // check source node inputs
    Assert.assertTrue(operation.getInputParameters().containsKey(generateSourceInputName(fake1)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateSourceInputName(fake2)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateSourceInputName(fake3)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateSourceInputName(fake5)));
    // check target node inputs
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetInputName(fake1)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetInputName(fake2)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetInputName(fake3)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetInputName(fake5)));
    // check targeted capability inputs
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetedCapaInputName(fakeCapa1, fake1)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetedCapaInputName(fakeCapa1, fake2)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetedCapaInputName(fakeCapa1, fake5)));
    Assert.assertTrue(operation.getInputParameters().containsKey(generateTargetedCapaInputName(fakeCapa1, fake3)));
}