Class MailSubjectGenerator

java.lang.Object
de.cuioss.test.generator.domain.MailSubjectGenerator
All Implemented Interfaces:
TypedGenerator<String>

public class MailSubjectGenerator extends Object implements TypedGenerator<String>
Generates realistic email subject lines for testing purposes, particularly focused on healthcare-related communications.

Subject line components:

  • Prefixes (0-3): "Re:", "Fw:", "Answ:", "Yep:"
  • Content words (0-7): Healthcare-related terms like "Patient", "Document", "Hospital", etc.

The generator creates subject lines by combining:

  1. Random number (0-3) of prefix elements
  2. Random number (0-7) of content words
  3. All elements are joined with spaces

Example outputs:

 "Re: Fw: Patient Document"
 "Hospital Doctor Referral"
 "Answ: Registration Physician"
 

Example usage:

 var generator = new MailSubjectGenerator();
 String subject = generator.next(); // Returns a randomly generated subject line
 
Author:
Oliver Wolff
  • Constructor Details

  • Method Details

    • next

      public String next()
      Description copied from interface: TypedGenerator
      Generates the next instance based on the generator's configuration. Implementations must ensure thread-safety.
      Specified by:
      next in interface TypedGenerator<String>
      Returns:
      A newly created instance. May be null if the generator explicitly supports null value generation.