-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34796da
commit 631b775
Showing
8 changed files
with
54 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class JakartaMailInstrumentationTest extends AgentTestRunner { | |
} | ||
|
||
|
||
void 'test jakarta mail Message text'() { | ||
void 'test jakarta mail Message HTML text'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
InstrumentationBridge.registerIastModule(module) | ||
|
@@ -41,6 +41,28 @@ class JakartaMailInstrumentationTest extends AgentTestRunner { | |
"html" | "<html><body>Hello, Content!</body></html>" | ||
} | ||
|
||
void 'test jakarta mail Message Plain text'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
InstrumentationBridge.registerIastModule(module) | ||
def session = Session.getDefaultInstance(new Properties()) | ||
def provider = new Provider(Provider.Type.TRANSPORT, "smtp", MockTransport.name, "MockTransport", "1.0") | ||
session.setProvider(provider) | ||
final message = new MimeMessage(session) | ||
message.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]")) | ||
message.setText(content, "utf-8", mimetype) | ||
|
||
when: | ||
Transport.send(message) | ||
|
||
then: | ||
0 * module.onSendEmail(message.getContent()) | ||
|
||
where: | ||
mimetype | content | ||
"plain" | "<html><body>Hello, Content!</body></html>" | ||
} | ||
|
||
void 'test jakarta mail Message Content'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class JavaxMailInstrumentationTest extends AgentTestRunner { | |
injectSysConfig("dd.iast.enabled", "true") | ||
} | ||
|
||
void 'test javax mail Message text'() { | ||
void 'test javax mail Message HTML text'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
InstrumentationBridge.registerIastModule(module) | ||
|
@@ -41,6 +41,28 @@ class JavaxMailInstrumentationTest extends AgentTestRunner { | |
"html" | "<html><body>Hello, Content!</body></html>" | ||
} | ||
|
||
void 'test javax mail Message Plain text'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
InstrumentationBridge.registerIastModule(module) | ||
def session = Session.getDefaultInstance(new Properties()) | ||
def provider = new Provider(Provider.Type.TRANSPORT, "smtp", MockTransport.name, "MockTransport", "1.0") | ||
session.setProvider(provider) | ||
final message = new MimeMessage(session) | ||
message.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]")) | ||
message.setText(content, "utf-8", mimetype) | ||
|
||
when: | ||
Transport.send(message) | ||
|
||
then: | ||
0 * module.onSendEmail(message.getContent()) | ||
|
||
where: | ||
mimetype | content | ||
"plain" | "<html><body>Hello, Content!</body></html>" | ||
} | ||
|
||
void 'test javax mail Message Content'() { | ||
given: | ||
final module = Mock(EmailInjectionModule) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters