File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/test/java/com/example/log4u/domain/follow Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1- name : log4u- dev-build
1+ name : dev-build
22on :
33 pull_request :
44 branches :
4646 -p 3307:3306 \
4747 mysql:8.0.33
4848
49+ - name : Wait for MySQL to be ready
50+ run : |
51+ for i in {1..10}; do
52+ if docker exec log4u-mysql mysqladmin ping -h "127.0.0.1" --silent; then
53+ echo "MySQL is ready!"
54+ break
55+ fi
56+ echo "Waiting for MySQL to start..."
57+ sleep 1
58+ done
59+ if ! docker exec log4u-mysql mysqladmin ping -h "127.0.0.1" --silent; then
60+ echo "MySQL did not start in time!"
61+ exit 1
62+ fi
63+
4964 - name : Build and analyze
5065 env :
5166 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ void createFollowFailureWithUserNotFound() {
6969 .isPremium (false )
7070 .build ();
7171
72- userRepository .save (user );
72+ final Long userId = userRepository .save (user ). getUserId ( );
7373
7474 assertThrows (UserNotFoundException .class ,
75- () -> followService .createFollow (user . getUserId () , WRONG_TARGET ));
75+ () -> followService .createFollow (userId , WRONG_TARGET ));
7676 }
7777
7878 @ Test
You can’t perform that action at this time.
0 commit comments