Skip to content

Commit a89b4f4

Browse files
ssambasuMarkLogic Builder
authored andcommitted
Removing spring dependencies for unit test
1 parent a0e2ca8 commit a89b4f4

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

marklogic-data-hub/src/main/java/com/marklogic/hub/flow/impl/FlowRunnerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public FlowRunnerImpl(HubConfig hubConfig) {
7474
this.destinationDatabase = hubConfig.getDbName(DatabaseKind.FINAL);
7575
}
7676

77+
//This constructor is only for unit testing purposes
78+
protected FlowRunnerImpl(){}
79+
7780
@Override
7881
public FlowRunner withFlow(Flow flow) {
7982
this.flow = flow;

marklogic-data-hub/src/test/java/com/marklogic/hub/flow/impl/FlowRunnerImplTest.java

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,17 @@
11
package com.marklogic.hub.flow.impl;
22

3-
import com.marklogic.bootstrap.Installer;
43
import com.marklogic.client.FailedRequestException;
54
import com.marklogic.client.impl.FailedRequest;
6-
import com.marklogic.hub.ApplicationConfig;
7-
import com.marklogic.hub.HubTestBase;
85
import com.marklogic.hub.flow.RunFlowResponse;
9-
import org.custommonkey.xmlunit.XMLUnit;
10-
11-
import org.junit.jupiter.api.AfterAll;
126
import org.junit.jupiter.api.Assertions;
13-
import org.junit.jupiter.api.BeforeEach;
147
import org.junit.jupiter.api.Test;
15-
import org.junit.jupiter.api.extension.ExtendWith;
16-
import org.springframework.test.context.ContextConfiguration;
17-
import org.springframework.test.context.junit.jupiter.SpringExtension;
188

19-
import java.io.IOException;
20-
@ExtendWith(SpringExtension.class)
21-
@ContextConfiguration(classes = ApplicationConfig.class)
22-
class FlowRunnerImplTest extends HubTestBase {
23-
@BeforeEach
24-
public void setup() throws IOException {
25-
XMLUnit.setIgnoreWhitespace(true);
26-
createProjectDir();
27-
getDataHubAdminConfig();
28-
}
9+
class FlowRunnerImplTest {
2910

30-
@AfterAll
31-
public static void cleanup() throws IOException {
32-
new Installer().teardownProject();
33-
}
3411
@Test
3512
public void testFlowRunnerException() {
3613
RunFlowResponse resp = null;
37-
FlowRunnerImpl fr = new FlowRunnerImpl(adminHubConfig);
14+
FlowRunnerImpl fr = new FlowRunnerImpl();
3815
FailedRequest req = new FailedRequest();
3916
req.setMessageCode("RESTAPI-SRVEXERR");
4017
req.setMessageString("{\n" +
@@ -54,7 +31,7 @@ public void testFlowRunnerException() {
5431
@Test
5532
public void testFlowRunnerExceptionWithoutPluginError() {
5633
RunFlowResponse resp = null;
57-
FlowRunnerImpl fr = new FlowRunnerImpl(adminHubConfig);
34+
FlowRunnerImpl fr = new FlowRunnerImpl();
5835
FailedRequest req = new FailedRequest();
5936
req.setMessageCode("RESTAPI-SRVEXERR");
6037
req.setMessageString("{\n" +

0 commit comments

Comments
 (0)