*/
@Test
public void testProcessTrigger() throws IOException, NugetPushException {
//GIVEN
final ClassicPackageSource classicPackageSource = new ClassicPackageSource(testFolder);
ModifyStrategy simplePushStrategy = new ModifyStrategy(true);
classicPackageSource.setPushStrategy(simplePushStrategy);
List<Nupkg> pushedPackages = new ArrayList<>();
//Пакет
final Nupkg nupkg = context.mock(Nupkg.class);
Expectations expectations = new Expectations();
expectations.atLeast(0).of(nupkg).getFileName();
expectations.will(returnValue("NUnit.2.5.9.10348.nupkg"));
expectations.atLeast(0).of(nupkg).getStream();
expectations.will(returnValue(this.getClass().getResourceAsStream("/NUnit.2.5.9.10348.nupkg")));
//Триггер
final BeforeTrigger trigger = context.mock(BeforeTrigger.class);
expectations.oneOf(trigger).doAction(nupkg, classicPackageSource);
expectations.will(new CallBackAction(pushedPackages));
context.checking(expectations);
simplePushStrategy.getBeforePushTriggers().add(trigger);
//WHEN
classicPackageSource.pushPackage(nupkg);
assertArrayEquals("Пакеты для которых вызывался триггер", new Nupkg[]{nupkg}, pushedPackages.toArray(new Nupkg[0]));