Commit 92f79832 authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/payments-service!15
parents 8d07991f 57505224
theGroup=ee.sm.ti.teis
theVersion=0.3.0
theVersion=1.0.0
pluginVersion=1.0.0
commonsVersion=1.0.0
commonApiGatewayVersion=0.25.0
commonsVersion=1.1.0
commonApiGatewayVersion=1.0.0
mapstructVersion=1.3.0.Final
querydslVersion=4.1.3
......@@ -51,7 +51,8 @@ VALUES ('254f1c13-6c07-44a6-ae6a-3543fa20e78f', 'margus meekas', '2020-01-22', 7
('88879a0d-48d8-4c52-b264-8068d42f41b7', 'Juhan Saar', now() - interval '1 day', 99.99, 'payment description 99.99', false, 0.00, 0.00, 'CURRENT'),
('e7088876-155a-4192-9495-b9ef909e7ae0', 'Juhan Saar', now() - interval '1 day', 99.99, 'payment description 99.99', false, 0.00, 0.00, 'CURRENT'),
('0e3e0858-8dca-4fdb-872d-1dd7a6364dde', 'Juhan Saar', now() - interval '1 day', 99.99, 'payment description 99.99', false, 0.00, 0.00, 'CURRENT'),
('f027219c-8ec6-40d4-9e68-56c2134e6efd', 'Juhan Saar', now() - interval '1 day', 99.99, 'payment description 99.99', false, 0.00, 0.00, 'CURRENT');
('f027219c-8ec6-40d4-9e68-56c2134e6efd', 'Juhan Saar', now() - interval '1 day', 99.99, 'payment description 99.99', false, 0.00, 0.00, 'CURRENT'),
('c1bf7e1d-e5ec-4172-9a86-666ae69bd067', 'Juhan Saar', now() - interval '1 day', 465.12, 'payment description 465.12', false, 0.00, 0.00, 'CURRENT');
INSERT INTO reconciliation (id, created_at, created_by, modified_at, modified_by, claim_id, payment_id, amount, object_status)
VALUES ('e5b5af0f-a342-4055-ac63-55ed79978289', null, null, null, null, 'e63b9fd5-ea40-49de-b233-1563bd5d44aa', '254f1c13-6c07-44a6-ae6a-3543fa20e78f', 32.56, 'CURRENT'),
......@@ -62,7 +63,7 @@ VALUES ('e5b5af0f-a342-4055-ac63-55ed79978289', null, null, null, null, 'e63b9fd
('9ead84e2-eb27-439b-932f-6b0998b6334a', now() - interval '1 day', null, null, null, '238d72fd-5f31-4c7c-be81-f9b7a71b409d', 'e7088876-155a-4192-9495-b9ef909e7ae0', 565.12, 'CURRENT'),
('c5d90e84-361f-405a-8a2a-e3fc3bb7fb0c', now() - interval '1 day', null, null, null, 'e8fc8130-7cdc-4ac1-afd0-0e1ecf174c81', 'f027219c-8ec6-40d4-9e68-56c2134e6efd', 565.12, 'DELETED'),
('93234876-b207-47cc-8501-dd2984fa2d50', now() - interval '1 day', null, null, null, 'f5a6d513-efe6-4c88-ae24-abbaa7d089ea', '0e3e0858-8dca-4fdb-872d-1dd7a6364dde', 565.12, 'CURRENT'),
('b79f534d-493c-4dda-93d6-08f6162657b0', now() - interval '1 day', null, null, null, '5520d023-e1cf-4c72-9741-b04c5ec02560', null, 565.12, 'CURRENT');
('b79f534d-493c-4dda-93d6-08f6162657b0', now() - interval '1 day', null, null, null, '5520d023-e1cf-4c72-9741-b04c5ec02560', 'c1bf7e1d-e5ec-4172-9a86-666ae69bd067', 565.12, 'CURRENT');
INSERT INTO data_object_reference (id, claim_id, data_object_id, data_object_type, not_for_bulk_change, object_status)
VALUES ('35eb0605-be65-40ae-a872-838ae7e0a7c2', 'e8fc8130-7cdc-4ac1-afd0-0e1ecf174c81', '5b254eae-5410-4eb0-8b4d-e5b094b55f66', 'OBJECT_TYPE__PROCEEDING', false, 'CURRENT'),
......
//package ee.sm.ti.teis.payments.claim.service;
//
//import ee.sm.ti.teis.cache.classifier.ClassifierService;
//import ee.sm.ti.teis.domain.ClassifierItem;
//import ee.sm.ti.teis.domain.common.SimpleMessageSource;
//import ee.sm.ti.teis.domain.task.DataObjectReference;
//import ee.sm.ti.teis.domain.task.Task;
//import ee.sm.ti.teis.payments.claim.entity.ClaimDefinitionEntity;
//import ee.sm.ti.teis.payments.claim.entity.ClaimEntity;
//import ee.sm.ti.teis.payments.claim.entity.DataObjectReferenceEntity;
//import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
//import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.extension.ExtendWith;
//import org.mockito.ArgumentCaptor;
//import org.mockito.Captor;
//import org.mockito.InjectMocks;
//import org.mockito.Mock;
//import org.mockito.junit.jupiter.MockitoExtension;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//
//import java.math.BigDecimal;
//import java.time.LocalDate;
//import java.time.LocalDateTime;
//import java.time.LocalTime;
//import java.util.Collections;
//import java.util.UUID;
//
//import static ee.sm.ti.teis.types.enums.AssigneeType.EMPLOYER;
//import static ee.sm.ti.teis.types.enums.TaskStatusType.TODO;
//import static ee.sm.ti.teis.types.enums.classifier.ObjectType.CLAIM_PAYMENT;
//import static org.assertj.core.api.Assertions.assertThat;
//import static org.mockito.ArgumentMatchers.any;
//import static org.mockito.ArgumentMatchers.anyString;
//import static org.mockito.ArgumentMatchers.eq;
//import static org.mockito.Mockito.verify;
//import static org.mockito.Mockito.when;
//
//@ExtendWith(MockitoExtension.class)
//class TaskNotifyServiceTest {
//
// @Mock
// RabbitTemplate msRabbitTemplate;
// @Mock
// SimpleMessageSource simpleMessageSource;
// @Mock
// ClassifierService classifierService;
//
// @InjectMocks
// TaskNotifyService service;
//
// @Captor
// ArgumentCaptor<TaskNotifyService.CreateTaskMsRequest> captor;
//
// @Test
// void createTask() {
// when(simpleMessageSource.getMessage(anyString(), any())).thenReturn(null);
// when(classifierService.getClassifierItem(eq("NEW_DATA_OBJECT_TYPE_ID"), any()))
// .thenReturn(ClassifierItem.builder().code("NEW_DATA_OBJECT_TYPE_CODE").build());
//
// ClaimEntity claim = new ClaimEntity();
// claim.setId(UUID.randomUUID());
// claim.setDeadlineDate(LocalDate.now());
// claim.setReference("test reference 123");
// claim.setEmployerId(UUID.randomUUID());
// claim.setAmount(BigDecimal.valueOf(1421.12));
//
// ClaimDefinitionEntity definition = new ClaimDefinitionEntity();
// definition.setTitle("test title 32");
//
// claim.setClaimDefinition(definition);
//
// DataObjectReferenceEntity dataObjectReferenceEntity = new DataObjectReferenceEntity();
// dataObjectReferenceEntity.setDataObjectId(UUID.randomUUID());
// dataObjectReferenceEntity.setDataObjectType("NEW_DATA_OBJECT_TYPE_ID");
// claim.setDataObjectReferences(Collections.singletonList(dataObjectReferenceEntity));
//
// service.createTask(claim, new RequestMetaDTO());
//
// verify(msRabbitTemplate).convertSendAndReceiveAsType(anyString(), captor.capture());
//
// Task task = captor.getValue().getPayload();
// assertThat(task.getTaskDefinition().getCode()).isEqualTo(CLAIM_PAYMENT.getCode());
// assertThat(task.getEmployer().getId()).isEqualTo(claim.getEmployerId());
// assertThat(task.getDeadline()).isEqualTo(LocalDateTime.of(claim.getDeadlineDate(), LocalTime.of(0, 0, 0)));
// assertThat(task.getReference()).isEqualTo(claim.getReference());
// assertThat(task.getStatus()).isEqualTo(TODO);
//
// DataObjectReference firstReference = task.getDataObjectReferences().get(0);
// assertThat(firstReference.getDataObjectId()).isEqualTo(claim.getId());
// assertThat(firstReference.getDataObjectType().getCode()).isEqualTo(CLAIM_PAYMENT.getCode());
//
// DataObjectReference secondReference = task.getDataObjectReferences().get(1);
// assertThat(secondReference.getDataObjectId()).isEqualTo(claim.getDataObjectReferences().get(0).getDataObjectId());
// assertThat(secondReference.getDataObjectType().getCode()).isEqualTo("NEW_DATA_OBJECT_TYPE_CODE");
//
// assertThat(task.getTaskAssignees().get(0).getAssigneeType()).isEqualTo(EMPLOYER);
// assertThat(task.getTaskAssignees().get(0).getEmployerId()).isEqualTo(claim.getEmployerId());
// }
//}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment