@BeforeMethod(groups = "unit")
  public void init() {
    factory = new RawExtractJobFactoryImpl();
    stagingDirectoryFactory = EasyMock.createMock(CredentialedStagingDirectoryFactory.class);
    stagingDirectory = EasyMock.createMock(StagingDirectory.class);
    EasyMock.expect(stagingDirectory.getAbsolutePath()).andStubReturn(PATH);

    EasyMock.expect(stagingDirectory.getSep()).andStubReturn("/");
    final Supplier<DisposableResourceTracker> trackerSupplier = EasyMockUtils.createMockSupplier();
    tracker = createMock(DisposableResourceTracker.class);
    expect(trackerSupplier.get()).andReturn(tracker);
    replay(trackerSupplier);
    rawPopulator = EasyMock.createMock(InputContext.class);

    converter = EasyMock.createMock(DTAToMzXMLConverter.class);
    options = new DTAToMzXMLOptions();

    factory.setDtaToMzXMLConverter(converter);
    factory.setDtaToMxXMLOptions(options);
    factory.setDisposableResourceTrackerSupplier(trackerSupplier);
    factory.setCredentialedStagingDirectoryFactory(stagingDirectoryFactory);
    mockObjects =
        MockObjectCollection.fromObjects(
            stagingDirectoryFactory, stagingDirectory, tracker, rawPopulator, converter);
  }
Beispiel #2
0
  @BeforeMethod(groups = "unit")
  public void init() {
    support = new EventSupportImpl();

    eventDispatcher = EasyMock.createMock(EventDispatcher.class);
    messageSource = EasyMock.createMock(MessageSource.class);

    collection.add(eventDispatcher);
    collection.add(messageSource);

    support.setEventDispatcher(eventDispatcher);
    support.setMessageSource(messageSource);
    event = null;
    eventDispatcher.fireEvent(
        EasyMockUtils.record(
            new EasyMockUtils.Recorder<EventBase>() {
              public void record(final EventBase object) {
                event = object;
              }
            }));

    EasyMock.expect(messageSource.getMessage("code", null)).andStubReturn("message");

    collection.replay();
    final User user = new User();
    user.setCagridId(userId);

    template = new EventBaseImpl();
    template.setJobId(jobId);
    template.setUserId(userId);
    template.setJobName(jobName);
    template.setWorkflowId(workflowId);
  }