Skip to content

Commit

Permalink
CIV-12772 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pliao-hmcts committed Jul 17, 2024
1 parent a94466e commit c591cd2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ private Map<String, String> getCommonProperties(CaseData caseData) {

private Map<String, String> getFurtherProperties(CaseData caseData) {
return switch (getEvent(caseData)) {
//case NO_REMISSION_HWF -> getNoRemissionProperties(caseData);
case MORE_INFORMATION_HWF_GA -> getMoreInformationProperties(caseData);
//case PARTIAL_REMISSION_HWF_GRANTED -> getPartialRemissionProperties(caseData);
//case INVALID_HWF_REFERENCE, UPDATE_HELP_WITH_FEE_NUMBER -> Collections.emptyMap();
default -> throw new NotificationException(new Exception(ERROR_HWF_EVENT));
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import uk.gov.hmcts.reform.ccd.client.model.Event;
import uk.gov.hmcts.reform.ccd.client.model.StartEventResponse;
import uk.gov.hmcts.reform.civil.enums.BusinessProcessStatus;
import uk.gov.hmcts.reform.civil.helpers.CaseDetailsConverter;
import uk.gov.hmcts.reform.civil.model.BusinessProcess;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
Expand All @@ -25,18 +24,10 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@SpringBootTest(classes = {
EndGaHwfNotifyProcessTaskHandler.class,
JacksonAutoConfiguration.class,
CaseDetailsConverter.class,
})
@ExtendWith(SpringExtension.class)
public class EndGaHwfNotifyProcessTaskHandlerTest {

Expand All @@ -49,10 +40,10 @@ public class EndGaHwfNotifyProcessTaskHandlerTest {
@Mock
private ExternalTaskService externalTaskService;

@MockBean
@Mock
private CoreCaseDataService coreCaseDataService;

@Autowired
@InjectMocks
private EndGaHwfNotifyProcessTaskHandler handler;

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,11 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {
HwfNotificationService.class,
JacksonAutoConfiguration.class
})
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class HwfNotificationServiceTest {

private static final String EMAIL_TEMPLATE_MORE_INFO_HWF = "test-hwf-more-info-id";
Expand All @@ -61,18 +55,18 @@ public class HwfNotificationServiceTest {
private static final String REFERENCE_NUMBER = "1";
private static final LocalDate NOW = LocalDate.now();

@MockBean
@Mock
private NotificationsProperties notificationsProperties;
@MockBean
@Mock
private NotificationService notificationService;
@MockBean
@Mock
private CoreCaseDataService coreCaseDataService;

@MockBean
@Mock
private CaseDetailsConverter caseDetailsConverter;
@MockBean
@Mock
private SolicitorEmailValidation solicitorEmailValidation;
@Autowired
@InjectMocks
private HwfNotificationService service;

private static final CaseData GA_CASE_DATA = CaseDataBuilder.builder()
Expand Down

0 comments on commit c591cd2

Please sign in to comment.