Files
GoMFT/internal/email/mock_email.go
StarFleetCPTN 3193bf5111 feat: Update dependencies and enhance job run details template
- Add new dependencies: `github.com/joho/godotenv`, `github.com/stretchr/testify`, and `gopkg.in/natefinch/lumberjack.v2`
- Remove indirect dependency on `github.com/joho/godotenv`
- Refactor JobRunDetails template to separate content rendering for improved testing
- Enhance error message display in JobRunDetails template
- Introduce new test files for JWT and password functionalities
- Add comprehensive tests for database operations and error handling
2025-03-13 18:40:40 -07:00

36 lines
838 B
Go

package email
import (
"fmt"
"github.com/starfleetcptn/gomft/internal/config"
)
// MockService implements the email Service for testing purposes
type MockService struct {
SendEmailCalls int
SendPasswordResetEmailCalls int
ReturnError error
}
// NewMockService creates a new mock email service
func NewMockService() *Service {
// Create minimal config
cfg := &config.Config{
Email: config.EmailConfig{
Enabled: false,
},
BaseURL: "http://localhost:8080",
}
return &Service{
Config: cfg,
}
}
// SendPasswordResetEmail mocks sending a password reset email
func (s *MockService) SendPasswordResetEmail(toEmail, username, resetToken string) error {
return fmt.Errorf("email service is disabled, reset link would be: %s/reset-password?token=%s",
"http://localhost:8080", resetToken)
}