JAVA-24160 Review log statements for projects - Week 33 - 2023

This commit is contained in:
timis1 2023-08-20 09:30:22 +03:00 committed by n
parent 9814ba18ae
commit 814604f2f4
6 changed files with 27 additions and 27 deletions

View File

@ -30,13 +30,13 @@ public class Java8ComparatorUnitTest {
System.out.println("************** Java 8 Comaparator **************"); System.out.println("************** Java 8 Comaparator **************");
Comparator<Player> byRanking = (Player player1, Player player2) -> Integer.compare(player1.getRanking(), player2.getRanking()); Comparator<Player> byRanking = (Player player1, Player player2) -> Integer.compare(player1.getRanking(), player2.getRanking());
System.out.println("Before Sorting : " + footballTeam);
Collections.sort(footballTeam, byRanking); Collections.sort(footballTeam, byRanking);
System.out.println("After Sorting : " + footballTeam); assertEquals(footballTeam.get(0).getName(), "Steven");
assertEquals(footballTeam.get(0) assertEquals(footballTeam.get(0).getRanking(), 45);
.getName(), "Steven"); assertEquals(footballTeam.get(1).getName(), "John");
assertEquals(footballTeam.get(2) assertEquals(footballTeam.get(1).getRanking(), 59);
.getRanking(), 67); assertEquals(footballTeam.get(2).getName(), "Roger");
assertEquals(footballTeam.get(2).getRanking(), 67);
} }
@Test @Test
@ -45,24 +45,24 @@ public class Java8ComparatorUnitTest {
System.out.println("********* byRanking *********"); System.out.println("********* byRanking *********");
Comparator<Player> byRanking = Comparator.comparing(Player::getRanking); Comparator<Player> byRanking = Comparator.comparing(Player::getRanking);
System.out.println("Before Sorting : " + footballTeam);
Collections.sort(footballTeam, byRanking); Collections.sort(footballTeam, byRanking);
System.out.println("After Sorting : " + footballTeam); assertEquals(footballTeam.get(0).getName(), "Steven");
assertEquals(footballTeam.get(0) assertEquals(footballTeam.get(0).getRanking(), 45);
.getName(), "Steven"); assertEquals(footballTeam.get(1).getName(), "John");
assertEquals(footballTeam.get(2) assertEquals(footballTeam.get(1).getRanking(), 59);
.getRanking(), 67); assertEquals(footballTeam.get(2).getName(), "Roger");
assertEquals(footballTeam.get(2).getRanking(), 67);
System.out.println("********* byAge *********"); System.out.println("********* byAge *********");
Comparator<Player> byAge = Comparator.comparing(Player::getAge); Comparator<Player> byAge = Comparator.comparing(Player::getAge);
System.out.println("Before Sorting : " + footballTeam);
Collections.sort(footballTeam, byAge); Collections.sort(footballTeam, byAge);
System.out.println("After Sorting : " + footballTeam); assertEquals(footballTeam.get(0).getName(), "Roger");
assertEquals(footballTeam.get(0) assertEquals(footballTeam.get(0).getAge(), 20);
.getName(), "Roger"); assertEquals(footballTeam.get(1).getName(), "John");
assertEquals(footballTeam.get(2) assertEquals(footballTeam.get(1).getAge(), 22);
.getRanking(), 45); assertEquals(footballTeam.get(2).getName(), "Steven");
assertEquals(footballTeam.get(2).getAge(), 24);
} }
} }

View File

@ -10,8 +10,8 @@ eureka.client.registryFetchIntervalSeconds = 5
management.security.sessions=never management.security.sessions=never
logging.level.org.springframework.web.=debug logging.level.org.springframework.web.=INFO
logging.level.org.springframework.security=debug logging.level.org.springframework.security=INFO
spring.redis.host=localhost spring.redis.host=localhost
spring.redis.port=6379 spring.redis.port=6379

View File

@ -6,8 +6,8 @@ eureka.client.registryFetchIntervalSeconds = 5
management.security.sessions=always management.security.sessions=always
logging.level.org.springframework.web.=debug logging.level.org.springframework.web.=INFO
logging.level.org.springframework.security=debug logging.level.org.springframework.security=INFO
spring.redis.host=localhost spring.redis.host=localhost
spring.redis.port=6379 spring.redis.port=6379

View File

@ -10,8 +10,8 @@ eureka.client.registryFetchIntervalSeconds = 5
management.security.sessions=never management.security.sessions=never
logging.level.org.springframework.web.=debug logging.level.org.springframework.web.=INFO
logging.level.org.springframework.security=debug logging.level.org.springframework.security=INFO
spring.redis.host=localhost spring.redis.host=localhost
spring.redis.port=6379 spring.redis.port=6379

View File

@ -4,4 +4,4 @@ server.port=9411
eureka.client.region = default eureka.client.region = default
eureka.client.registryFetchIntervalSeconds = 5 eureka.client.registryFetchIntervalSeconds = 5
logging.level.org.springframework.web=debug logging.level.org.springframework.web=INFO

View File

@ -4,7 +4,7 @@ feign.okhttp.enabled=true
server.port=8085 server.port=8085
spring.main.allow-bean-definition-overriding=true spring.main.allow-bean-definition-overriding=true
logging.level.com.baeldung.cloud.openfeign.client=DEBUG logging.level.com.baeldung.cloud.openfeign.client=INFO
feign.hystrix.enabled=true feign.hystrix.enabled=true
spring.cloud.openfeign.client.config.postClient.url=https://jsonplaceholder.typicode.com/posts/ spring.cloud.openfeign.client.config.postClient.url=https://jsonplaceholder.typicode.com/posts/