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