This commit is contained in:
AKurakin 2023-05-24 18:59:12 +03:00
parent be2d9aa234
commit 2d7bfae8a0
3 changed files with 30 additions and 3 deletions

View file

@ -27,6 +27,8 @@ import java.util.concurrent.Future;
* <p>
* Ожидает из очереди (CommonIdRequest)
*
* Похожая функция ожидания: KafkaSender.sendToQueueWaitForAnswer
*
* @param <TOut> отправляется в очередь
*/
public class BiDirectionQueueExchanger<TOut extends BaseRequest<?>> extends QueueConsumer implements Closeable {

View file

@ -1,7 +1,5 @@
package ru.spcex.clearing.lim.exporter.services;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
@ -74,7 +72,7 @@ public abstract class AbstractExporterService {
sendLimExportedNotification(fileName);
}
private void sendLimExportedNotification(String fileName) {
void sendLimExportedNotification(String fileName) {
LimExportedRequest limExportedRequest = new LimExportedRequest();
limExportedRequest.setLimFileName(fileName);
log.debug("Send message to kafka \"{}\": {}", LIM_EXPORTED, LogFormatter.toStringWrapper(limExportedRequest));

View file

@ -0,0 +1,27 @@
package ru.spcex.clearing.lim.exporter.services;
import org.junit.jupiter.api.Test;
import ru.spcex.clearing.lim.exporter.AbstractServiceTest;
import ru.spcex.clearing.test.TestUtils;
import javax.annotation.PostConstruct;
import java.time.LocalDateTime;
import static org.junit.jupiter.api.Assertions.*;
class AbstractExporterServiceTest extends AbstractServiceTest {
@PostConstruct
public void init() {
super.init();
}
@Test
void sendLimExportedNotification() {
AbstractExporterService moneyExporterService = new MoneyExporterService(null, kafkaSender, imdgProvider);
String fileName = "limits_money_202305241832.lim";
moneyExporterService.sendLimExportedNotification(fileName);
//TestUtils.waitingSendAndCheckRecord(null, mockProducer);
}
}