File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
05-02-timeouts/internal/platform/storage/mysql
06-02-time-parse-in-go/internal/platform/storage/mysql
06-03-gin-middlewares/internal/platform/storage/mysql Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "errors"
66 "testing"
7+ "time"
78
89 mooc "github.com/CodelyTV/go-hexagonal_http_api-course/05-02-timeouts/internal"
910 "github.com/DATA-DOG/go-sqlmock"
@@ -24,7 +25,7 @@ func Test_CourseRepository_Save_RepositoryError(t *testing.T) {
2425 WithArgs (courseID , courseName , courseDuration ).
2526 WillReturnError (errors .New ("something-failed" ))
2627
27- repo := NewCourseRepository (db )
28+ repo := NewCourseRepository (db , 1 * time . Millisecond )
2829
2930 err = repo .Save (context .Background (), course )
3031
@@ -45,7 +46,7 @@ func Test_CourseRepository_Save_Succeed(t *testing.T) {
4546 WithArgs (courseID , courseName , courseDuration ).
4647 WillReturnResult (sqlmock .NewResult (0 , 1 ))
4748
48- repo := NewCourseRepository (db )
49+ repo := NewCourseRepository (db , 1 * time . Millisecond )
4950
5051 err = repo .Save (context .Background (), course )
5152
Original file line number Diff line number Diff line change 44 "context"
55 "errors"
66 "testing"
7+ "time"
78
89 mooc "github.com/CodelyTV/go-hexagonal_http_api-course/06-02-time-parse-in-go/internal"
910 "github.com/DATA-DOG/go-sqlmock"
@@ -24,7 +25,7 @@ func Test_CourseRepository_Save_RepositoryError(t *testing.T) {
2425 WithArgs (courseID , courseName , courseDuration ).
2526 WillReturnError (errors .New ("something-failed" ))
2627
27- repo := NewCourseRepository (db )
28+ repo := NewCourseRepository (db , 1 * time . Millisecond )
2829
2930 err = repo .Save (context .Background (), course )
3031
@@ -45,7 +46,7 @@ func Test_CourseRepository_Save_Succeed(t *testing.T) {
4546 WithArgs (courseID , courseName , courseDuration ).
4647 WillReturnResult (sqlmock .NewResult (0 , 1 ))
4748
48- repo := NewCourseRepository (db )
49+ repo := NewCourseRepository (db , 1 * time . Millisecond )
4950
5051 err = repo .Save (context .Background (), course )
5152
Original file line number Diff line number Diff line change 44 "context"
55 "errors"
66 "testing"
7+ "time"
78
89 mooc "github.com/CodelyTV/go-hexagonal_http_api-course/06-03-gin-middlewares/internal"
910 "github.com/DATA-DOG/go-sqlmock"
@@ -24,7 +25,7 @@ func Test_CourseRepository_Save_RepositoryError(t *testing.T) {
2425 WithArgs (courseID , courseName , courseDuration ).
2526 WillReturnError (errors .New ("something-failed" ))
2627
27- repo := NewCourseRepository (db )
28+ repo := NewCourseRepository (db , 1 * time . Millisecond )
2829
2930 err = repo .Save (context .Background (), course )
3031
@@ -45,7 +46,7 @@ func Test_CourseRepository_Save_Succeed(t *testing.T) {
4546 WithArgs (courseID , courseName , courseDuration ).
4647 WillReturnResult (sqlmock .NewResult (0 , 1 ))
4748
48- repo := NewCourseRepository (db )
49+ repo := NewCourseRepository (db , 1 * time . Millisecond )
4950
5051 err = repo .Save (context .Background (), course )
5152
You can’t perform that action at this time.
0 commit comments