Skip to content

Commit

Permalink
MODTLR-10 Revert cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrVidinieiev committed Jan 25, 2024
1 parent 762a2f1 commit bb74f55
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/folio/client/CirculationClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
public interface CirculationClient {

@PostMapping("/circulation/requests")
Request createTitleLevelRequest(Request request);
Request createRequest(Request request);
}
2 changes: 1 addition & 1 deletion src/main/java/org/folio/controller/EcsTlrController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public ResponseEntity<EcsTlr> getEcsTlrById(UUID requestId) {
public ResponseEntity<EcsTlr> postEcsTlr(EcsTlr ecsTlr) {
log.debug("postEcsTlr:: parameters ecsTlr: {}", ecsTlr);

return ResponseEntity.status(CREATED).body(ecsTlrService.create(ecsTlr));
return ResponseEntity.status(CREATED).body(ecsTlrService.post(ecsTlr));
}
}
12 changes: 6 additions & 6 deletions src/main/java/org/folio/domain/mapper/EcsTlrMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ default EcsTlr.FulfillmentPreferenceEnum mapFulfillmentPreference(String fulfill
}

@Named("RequestTypeToString")
default String mapRequestType(EcsTlr.RequestTypeEnum requestType) {
return requestType != null ? requestType.getValue() : null;
default String mapRequestTypeToString(EcsTlr.RequestTypeEnum requestTypeEnum) {
return requestTypeEnum != null ? requestTypeEnum.getValue() : null;
}

@Named("RequestLevelToString")
default String mapRequestLevel(EcsTlr.RequestLevelEnum requestLevel) {
return requestLevel != null ? requestLevel.getValue() : null;
default String mapRequestLevelToString(EcsTlr.RequestLevelEnum requestLevelEnum) {
return requestLevelEnum != null ? requestLevelEnum.getValue() : null;
}

@Named("FulfillmentPreferenceToString")
default String mapFulfillmentPreference(EcsTlr.FulfillmentPreferenceEnum fulfillmentPreference) {
return fulfillmentPreference != null ? fulfillmentPreference.getValue() : null;
default String mapFulfillmentPreferenceToString(EcsTlr.FulfillmentPreferenceEnum fulfillmentPreferenceEnum) {
return fulfillmentPreferenceEnum != null ? fulfillmentPreferenceEnum.getValue() : null;
}

Request mapDtoToRequest(EcsTlr ecsTlr);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/folio/service/EcsTlrService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

public interface EcsTlrService {
Optional<EcsTlr> get(UUID requestId);
EcsTlr create(EcsTlr ecsTlr);
EcsTlr post(EcsTlr ecsTlr);
}
4 changes: 2 additions & 2 deletions src/main/java/org/folio/service/impl/EcsTlrServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Optional<EcsTlr> get(UUID id) {
}

@Override
public EcsTlr create(EcsTlr ecsTlr) {
public EcsTlr post(EcsTlr ecsTlr) {
log.debug("create:: parameters ecsTlr: {}", () -> ecsTlr);
createRequest(ecsTlr, "university"); // TODO: replace with real tenantId

Expand All @@ -46,7 +46,7 @@ private Request createRequest(EcsTlr ecsTlr, String tenantId) {
log.info("createRequest:: creating request for ECS TLR {} and tenant {}", ecsTlr.getId(), tenantId);
Request mappedRequest = requestsMapper.mapDtoToRequest(ecsTlr);
Request createdRequest = tenantScopedExecutionService.execute(tenantId,
() -> circulationClient.createTitleLevelRequest(mappedRequest));
() -> circulationClient.createRequest(mappedRequest));
log.info("createRequest:: request created: {}", createdRequest.getId());
log.debug("createRequest:: request={}", () -> createdRequest);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void getById() {
@Test
void ecsTlrShouldSuccessfullyBeCreated() {
var mockRequest = new EcsTlr();
when(requestsService.create(any(EcsTlr.class))).thenReturn(mockRequest);
when(requestsService.post(any(EcsTlr.class))).thenReturn(mockRequest);

var response = requestsController.postEcsTlr(new EcsTlr());

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/folio/service/EcsTlrServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void postEcsTlr() {
when(ecsTlrRepository.save(any(EcsTlrEntity.class))).thenReturn(mockEcsTlrEntity);
when(tenantScopedExecutionService.execute(any(String.class), any()))
.thenReturn(new Request().id(UUID.randomUUID().toString()));
var postEcsTlr = ecsTlrService.create(ecsTlr);
var postEcsTlr = ecsTlrService.post(ecsTlr);

assertEquals(id.toString(), postEcsTlr.getId());
assertEquals(instanceId.toString(), postEcsTlr.getInstanceId());
Expand Down

0 comments on commit bb74f55

Please sign in to comment.