Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,10 @@
"id": "source-storage-records",
"version": "3.4"
},
{
"id": "source-storage-snapshots",
"version": "2.1"
},
{
"id": "bound-with-parts-storage",
"version": "2.0"
Expand All @@ -750,6 +754,14 @@
"id": "mapping-metadata-provider",
"version": "1.1"
},
{
"id": "source-manager-job-executions",
"version": "3.4"
},
{
"id": "source-manager-records",
"version": "2.1"
},
{
"id": "data-import-converter-storage",
"version": "1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.folio.rest.jaxrs.model.InitJobExecutionsRqDto;
import org.folio.rest.jaxrs.model.JobExecution;
import org.folio.rest.jaxrs.model.JobProfileInfo;
import org.folio.rest.jaxrs.model.ParsedRecordDto;
import org.folio.rest.jaxrs.model.RawRecordsDto;
import org.folio.rest.jaxrs.model.StatusDto;

Expand All @@ -28,7 +27,6 @@ public class ChangeManagerClientWrapper extends ChangeManagerClient {
private final String requestId;
private final WebClient webClient;
public static final String CHANGE_MANAGER_JOB_EXECUTIONS = "/change-manager/jobExecutions/";
public static final String CHANGE_MANAGER_PARSED_RECORDS = "/change-manager/parsedRecords/";

public ChangeManagerClientWrapper(String okapiUrl, String tenantId, String token, String userId, String requestId, HttpClient httpClient) {
super(okapiUrl, tenantId, token, httpClient);
Expand Down Expand Up @@ -78,10 +76,4 @@ public Future<HttpResponse<Buffer>> putChangeManagerJobExecutionsStatusById(Stri
.sendBuffer(getBuffer(statusDto));
}

@Override
public Future<HttpResponse<Buffer>> putChangeManagerParsedRecordsById(String id, ParsedRecordDto parsedRecordDto) {
return createRequest(HttpMethod.PUT, okapiUrl + CHANGE_MANAGER_PARSED_RECORDS + id,
okapiUrl, tenantId, token, userId, requestId, webClient)
.sendBuffer(getBuffer(parsedRecordDto));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.folio.rest.jaxrs.model.InitJobExecutionsRqDto;
import org.folio.rest.jaxrs.model.JobExecution;
import org.folio.rest.jaxrs.model.JobProfileInfo;
import org.folio.rest.jaxrs.model.ParsedRecordDto;
import org.folio.rest.jaxrs.model.RawRecordsDto;
import org.folio.rest.jaxrs.model.StatusDto;
import org.junit.Before;
Expand Down Expand Up @@ -47,7 +46,6 @@ public class ChangeManagerClientWrapperTest {
private JobExecution stubJobExecution;
private JobProfileInfo stubJobProfileInfo;
private StatusDto stubStatusDto;
private ParsedRecordDto stubParsedRecordDto;
private static final String TOKEN = "token";
private static final String USER_ID = "userId";
private static final String REQUEST_ID = "requestId";
Expand All @@ -68,7 +66,6 @@ public void setUp() {
stubJobExecution = new JobExecution().withId(UUID.randomUUID().toString());
stubJobProfileInfo = new JobProfileInfo().withId(UUID.randomUUID().toString());
stubStatusDto = new StatusDto();
stubParsedRecordDto = new ParsedRecordDto().withId(UUID.randomUUID().toString());

WireMock.stubFor(post(new UrlPathPattern(new RegexPattern("/change-manager/jobExecutions"), true))
.withHeader(OKAPI_URL, equalTo(mockServer.baseUrl()))
Expand Down Expand Up @@ -105,13 +102,6 @@ public void setUp() {
.withHeader(OKAPI_TENANT, equalTo(TENANT_ID))
.withHeader(OKAPI_USER_ID, equalTo(USER_ID))
.willReturn(WireMock.ok()));

WireMock.stubFor(put(new UrlPathPattern(new RegexPattern("/change-manager/parsedRecords/" + stubParsedRecordDto.getId()), true))
.withHeader(OKAPI_URL, equalTo(mockServer.baseUrl()))
.withHeader(OKAPI_TOKEN, equalTo(TOKEN))
.withHeader(OKAPI_TENANT, equalTo(TENANT_ID))
.withHeader(OKAPI_USER_ID, equalTo(USER_ID))
.willReturn(WireMock.ok()));
}

@Test
Expand Down Expand Up @@ -182,18 +172,4 @@ public void shouldPutChangeManagerJobExecutionsStatusById(TestContext context) {
async.complete();
});
}

@Test
public void shouldPutChangeManagerParsedRecordsById(TestContext context) {
Async async = context.async();

Future<HttpResponse<Buffer>> optionalFuture = changeManagerClientWrapper
.putChangeManagerParsedRecordsById(stubParsedRecordDto.getId(), stubParsedRecordDto);

optionalFuture.onComplete(ar -> {
context.assertTrue(ar.succeeded());
context.assertEquals(ar.result().statusCode(), SC_OK);
async.complete();
});
}
}