Implementation implementation = waitForImplByName(null,
"S07-implementation-02");
Instance instance = implementation.createInstance(null, null);
S07ImplementationImporter02 dependency = (S07ImplementationImporter02) instance
.getServiceObject();
auxListProperties(dependency.getInjected());
auxListInstances();
ComponentImpl ci = (ComponentImpl) implementation;
Assert.assertTrue(
String.format(
"Only one link should have been created, but %s links were found",
ci.getLocalLinks().size()),
ci.getLocalLinks().size() == 1);
for (Link link : ci.getLocalLinks()) {
validateSourceTargetTypes(link.getSource(), link.getDestination(),
Implementation.class, Specification.class);
}
String messageTemplate = "Declaring a relation from source %s to target %s, instantiated object of the type %s which is not the targetKind expected.";
Assert.assertTrue(
String.format(messageTemplate, "Implementation",
"Specification", instance.getServiceObject()),
dependency.getInjected().getProperty("instance-property") == null
&& dependency.getInjected().getProperty(
"implementation-property") == null
&& dependency.getInjected().getProperty(
"specification-property") != null);
}