Search in sources :

Example 1 with DataCaptureModuleServiceBean

use of edu.harvard.iq.dataverse.datacapturemodule.DataCaptureModuleServiceBean in project dataverse by IQSS.

the class RequestRsyncScriptCommandTest method setUp.

@Before
public void setUp() {
    testEngine = new TestDataverseEngine(new TestCommandContext() {

        @Override
        public DataCaptureModuleServiceBean dataCaptureModule() {
            return new DataCaptureModuleServiceBean() {

                @Override
                public UploadRequestResponse requestRsyncScriptCreation(String jsonString, String dcmBaseUrl) {
                    return new UploadRequestResponse(200, "myResponse");
                }

                @Override
                public ScriptRequestResponse retreiveRequestedRsyncScript(String datasetIdentifier, String dcmBaseUrl) {
                    int httpStatusCode = 200;
                    long userId = 123l;
                    String script = "theScript";
                    ScriptRequestResponse scriptRequestResponse = new ScriptRequestResponse(httpStatusCode, datasetIdentifier, userId, script);
                    return scriptRequestResponse;
                }
            };
        }

        @Override
        public SettingsServiceBean settings() {
            return new MockSettingsSvc();
        }
    });
}
Also used : ScriptRequestResponse(edu.harvard.iq.dataverse.datacapturemodule.ScriptRequestResponse) TestCommandContext(edu.harvard.iq.dataverse.engine.TestCommandContext) UploadRequestResponse(edu.harvard.iq.dataverse.datacapturemodule.UploadRequestResponse) DataCaptureModuleServiceBean(edu.harvard.iq.dataverse.datacapturemodule.DataCaptureModuleServiceBean) TestDataverseEngine(edu.harvard.iq.dataverse.engine.TestDataverseEngine) Before(org.junit.Before)

Aggregations

DataCaptureModuleServiceBean (edu.harvard.iq.dataverse.datacapturemodule.DataCaptureModuleServiceBean)1 ScriptRequestResponse (edu.harvard.iq.dataverse.datacapturemodule.ScriptRequestResponse)1 UploadRequestResponse (edu.harvard.iq.dataverse.datacapturemodule.UploadRequestResponse)1 TestCommandContext (edu.harvard.iq.dataverse.engine.TestCommandContext)1 TestDataverseEngine (edu.harvard.iq.dataverse.engine.TestDataverseEngine)1 Before (org.junit.Before)1