(t *testing.T)
| 146 | } |
| 147 | |
| 148 | func TestGetReconciliation_NotFound(t *testing.T) { |
| 149 | db, mock, err := sqlmock.New() |
| 150 | assert.NoError(t, err) |
| 151 | defer func() { _ = db.Close() }() |
| 152 | |
| 153 | ds := Datasource{Conn: db} |
| 154 | ctx := context.TODO() |
| 155 | |
| 156 | mock.ExpectQuery("SELECT id, reconciliation_id, upload_id, status"). |
| 157 | WithArgs("rec123"). |
| 158 | WillReturnError(sql.ErrNoRows) |
| 159 | |
| 160 | _, err = ds.GetReconciliation(ctx, "rec123") |
| 161 | assert.Error(t, err) |
| 162 | assert.Equal(t, apierror.ErrNotFound, err.(apierror.APIError).Code) |
| 163 | } |
| 164 | |
| 165 | func TestUpdateReconciliationStatus_Success(t *testing.T) { |
| 166 | db, mock, err := sqlmock.New() |
nothing calls this directly
no test coverage detected