Commit 8291abe0 authored by dietricf's avatar dietricf
Browse files

SI-720 Natural Sortorder / Fix RabbitConnection while unittesting

parent fb85890d
......@@ -29,9 +29,8 @@ import java.util.UUID;
@Repository
public interface FailureInformationRepository extends PagingAndSortingRepository<TblFailureInformation, Long > {
Page<TblFailureInformation> findByTblFailureInformationCondensedIdIsNullOrderByFailureBeginDescIdAsc(Pageable pageable); // NOSONAR
Page<TblFailureInformation> findByTblFailureInformationCondensedIdIsNull(Pageable pageable); // NOSONAR
// _fd 03.03.2020: Name of function cannot be changed
Optional<TblFailureInformation> findByUuid(UUID uuid);
List<TblFailureInformation> findByUuidIn(List<UUID> uuidList);
......
......@@ -98,7 +98,7 @@ public class FailureInformationService {
public Page<FailureInformationDto> findFailureInformations(Pageable pageable) {
Page<FailureInformationDto> retPage = failureInformationRepository
.findByTblFailureInformationCondensedIdIsNull(pageable)
.findByTblFailureInformationCondensedIdIsNullOrderByFailureBeginDescIdAsc(pageable)
.map(failureInformationMapper::toFailureInformationDto);
retPage.getContent().forEach(this::enrichFailureInfo);
......
......@@ -69,9 +69,13 @@ email:
spring:
profiles: test
datasource:
url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
rabbitmq:
listener:
simple:
auto-startup: false
jpa:
hibernate:
ddl-auto: create
......
......@@ -78,7 +78,7 @@ public class FailureInformationServiceTest {
//TblStation tblStation = MockDataHelper.mockTblStation();
//List<TblAddress> addressList = MockDataHelper.mockTblAddressList();
when(failureInformationRepository.findByTblFailureInformationCondensedIdIsNull(any(Pageable.class))).thenReturn(mockfailurePage);
when(failureInformationRepository.findByTblFailureInformationCondensedIdIsNullOrderByFailureBeginDescIdAsc(any(Pageable.class))).thenReturn(mockfailurePage);
//when(stationRepository.findByStationId(anyString())).thenReturn(Optional.of(tblStation));
//when(addressRepository.findByStationId(anyString())).thenReturn(addressList);
......
Markdown is supported
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