FINERACT-2380: move retrofit client based test to feign

This commit is contained in:
Adam Saghy
2025-11-26 10:47:29 +01:00
parent 5d2a9c5390
commit f28382b70f
22 changed files with 98 additions and 158 deletions
@@ -51,6 +51,8 @@ public class BasicAuthRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
template.header(AUTHORIZATION_HEADER, BASIC_AUTH_PREFIX + credentials);
if (!template.headers().containsKey(AUTHORIZATION_HEADER)) {
template.header(AUTHORIZATION_HEADER, BASIC_AUTH_PREFIX + credentials);
}
}
}
@@ -61,7 +61,6 @@ import org.apache.fineract.client.feign.services.EntityDataTableApi;
import org.apache.fineract.client.feign.services.EntityFieldConfigurationApi;
import org.apache.fineract.client.feign.services.ExternalAssetOwnerLoanProductAttributesApi;
import org.apache.fineract.client.feign.services.ExternalAssetOwnersApi;
import org.apache.fineract.client.feign.services.ExternalAssetOwnersApiExtension;
import org.apache.fineract.client.feign.services.ExternalEventConfigurationApi;
import org.apache.fineract.client.feign.services.ExternalServicesApi;
import org.apache.fineract.client.feign.services.FetchAuthenticatedUserDetailsApi;
@@ -96,7 +95,6 @@ import org.apache.fineract.client.feign.services.LoanCobCatchUpApi;
import org.apache.fineract.client.feign.services.LoanCollateralApi;
import org.apache.fineract.client.feign.services.LoanCollateralManagementApi;
import org.apache.fineract.client.feign.services.LoanDisbursementDetailsApi;
import org.apache.fineract.client.feign.services.LoanDisbursementDetailsApiExtension;
import org.apache.fineract.client.feign.services.LoanInterestPauseApi;
import org.apache.fineract.client.feign.services.LoanProductsApi;
import org.apache.fineract.client.feign.services.LoanReschedulingApi;
@@ -394,10 +392,6 @@ public final class FineractFeignClient {
return create(ExternalAssetOwnersApi.class);
}
public ExternalAssetOwnersApiExtension externalAssetOwnersExtension() {
return create(ExternalAssetOwnersApiExtension.class);
}
public ExternalEventConfigurationApi externalEventConfiguration() {
return create(ExternalEventConfigurationApi.class);
}
@@ -534,10 +528,6 @@ public final class FineractFeignClient {
return create(LoanDisbursementDetailsApi.class);
}
public LoanDisbursementDetailsApiExtension loanDisbursementDetailsExtension() {
return create(LoanDisbursementDetailsApiExtension.class);
}
public LoanInterestPauseApi loanInterestPause() {
return create(LoanInterestPauseApi.class);
}
@@ -1,40 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.client.feign.services;
import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
import java.util.Map;
import org.apache.fineract.client.models.ExternalAssetOwnerRequest;
import org.apache.fineract.client.models.PostInitiateTransferResponse;
public interface ExternalAssetOwnersApiExtension {
@RequestLine("POST /v1/external-asset-owners/transfers/{id}")
@Headers("Content-Type: application/json")
PostInitiateTransferResponse transferRequestWithIdWithBody(@Param("id") Long id, ExternalAssetOwnerRequest body,
@QueryMap Map<String, Object> queryParams);
@RequestLine("POST /v1/external-asset-owners/transfers/external-id/{externalId}")
@Headers("Content-Type: application/json")
PostInitiateTransferResponse transferRequestWithId1WithBody(@Param("externalId") String externalId, ExternalAssetOwnerRequest body,
@QueryMap Map<String, Object> queryParams);
}
@@ -1,31 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.client.feign.services;
import feign.Param;
import feign.RequestLine;
import org.apache.fineract.client.models.PostAddAndDeleteDisbursementDetailRequest;
public interface LoanDisbursementDetailsApiExtension {
@RequestLine("PUT /v1/loans/{loanId}/disbursements/editDisbursements")
PostAddAndDeleteDisbursementDetailRequest addAndDeleteDisbursementDetail(@Param("loanId") Long loanId,
PostAddAndDeleteDisbursementDetailRequest postAddAndDeleteDisbursementDetailRequest);
}