@Test public void test_should_return_default_escalation_hours_if_configured_value_not_present() { final long designationId = 2L; final long complaintTypeId = 1L; final String tenantId = "tenantId"; final EscalationHoursSearchCriteria searchCriteria = EscalationHoursSearchCriteria.builder() .complaintTypeId(complaintTypeId) .designationId(designationId) .tenantId(tenantId) .build(); when(escalationJpaRepository.findBy(designationId, complaintTypeId, tenantId)) .thenReturn(null); final int actualEscalationHours = escalationRepository.getEscalationHours(searchCriteria); assertEquals(DEFAULT_ESCALATION_HOURS, actualEscalationHours); }
public int getEscalationHours(EscalationHoursSearchCriteria searchCriteria) { final Integer configuredEscalationHours = escalationJpaRepository. findBy(searchCriteria.getDesignationId(), searchCriteria.getComplaintTypeId(), searchCriteria.getTenantId()); return Optional.ofNullable(configuredEscalationHours) .orElse(defaultEscalationHours); }
EscalationRepository { public int getEscalationHours(EscalationHoursSearchCriteria searchCriteria) { final Integer configuredEscalationHours = escalationJpaRepository. findBy(searchCriteria.getDesignationId(), searchCriteria.getComplaintTypeId(), searchCriteria.getTenantId()); return Optional.ofNullable(configuredEscalationHours) .orElse(defaultEscalationHours); } }
EscalationRepository { public int getEscalationHours(EscalationHoursSearchCriteria searchCriteria) { final Integer configuredEscalationHours = escalationJpaRepository. findBy(searchCriteria.getDesignationId(), searchCriteria.getComplaintTypeId(), searchCriteria.getTenantId()); return Optional.ofNullable(configuredEscalationHours) .orElse(defaultEscalationHours); } EscalationRepository(@Value("${defaults.escalationHours}") int defaultEscalationHours,
                                EscalationJpaRepository escalationJpaRepository); }
EscalationRepository { public int getEscalationHours(EscalationHoursSearchCriteria searchCriteria) { final Integer configuredEscalationHours = escalationJpaRepository. findBy(searchCriteria.getDesignationId(), searchCriteria.getComplaintTypeId(), searchCriteria.getTenantId()); return Optional.ofNullable(configuredEscalationHours) .orElse(defaultEscalationHours); } EscalationRepository(@Value("${defaults.escalationHours}") int defaultEscalationHours,
                                EscalationJpaRepository escalationJpaRepository); int getEscalationHours(EscalationHoursSearchCriteria searchCriteria); EscalationTimeTypeReq persistCreateEscalationTimeType(final EscalationTimeTypeReq escalationTimeTypeRequest); EscalationTimeTypeReq persistUpdateEscalationTimeType(final EscalationTimeTypeReq escalationTimeTypeRequest); List<EscalationTimeType> getAllEscalationTimeTypes(final EscalationTimeTypeGetReq escalationGetRequest); boolean checkRecordExists(EscalationTimeTypeReq escalationTimeTypeReq); }
EscalationRepository { public int getEscalationHours(EscalationHoursSearchCriteria searchCriteria) { final Integer configuredEscalationHours = escalationJpaRepository. findBy(searchCriteria.getDesignationId(), searchCriteria.getComplaintTypeId(), searchCriteria.getTenantId()); return Optional.ofNullable(configuredEscalationHours) .orElse(defaultEscalationHours); } EscalationRepository(@Value("${defaults.escalationHours}") int defaultEscalationHours,
                                EscalationJpaRepository escalationJpaRepository); int getEscalationHours(EscalationHoursSearchCriteria searchCriteria); EscalationTimeTypeReq persistCreateEscalationTimeType(final EscalationTimeTypeReq escalationTimeTypeRequest); EscalationTimeTypeReq persistUpdateEscalationTimeType(final EscalationTimeTypeReq escalationTimeTypeRequest); List<EscalationTimeType> getAllEscalationTimeTypes(final EscalationTimeTypeGetReq escalationGetRequest); boolean checkRecordExists(EscalationTimeTypeReq escalationTimeTypeReq);  }