final Task artifactTaskMock = context.mock(Task.class, "artifactTask");
final Configuration otherConfiguration = context.mock(Configuration.class);
final TaskDependency otherArtifactTaskDependencyMock = context.mock(TaskDependency.class, "otherConfTaskDep");
final PublishArtifact otherArtifact = context.mock(PublishArtifact.class, "otherArtifact");
final PublishArtifactSet inheritedArtifacts = new DefaultPublishArtifactSet("artifacts", toDomainObjectSet(PublishArtifact.class, otherArtifact));
DefaultPublishArtifact artifact = createPublishArtifact("name1", "ext1", "type1", "classifier1");
artifact.builtBy(artifactTaskMock);
configuration.getArtifacts().add(artifact);
context.checking(new Expectations() {{
allowing(otherConfiguration).getHierarchy();
will(returnValue(toSet()));