-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
email-service-api - module, email client test, fixing NPE on EmailUtil
- Loading branch information
1 parent
bde1902
commit 9118dc3
Showing
13 changed files
with
119 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ nbdist/ | |
# Logs | ||
###################### | ||
*.log* | ||
.dmp | ||
.trc | ||
.txt |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package gt.api.email; | ||
|
||
import org.springframework.cloud.openfeign.FeignClient; | ||
|
||
@FeignClient(name = "email-service", url = "${feign-clients.email-service.url}") | ||
public interface EmailClient extends EmailService { | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package gt.app.web.rest; | ||
|
||
import gt.api.email.EmailClient; | ||
import gt.api.email.EmailDto; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("tests") | ||
@AllArgsConstructor | ||
@Profile("dev") | ||
public class TestResource { | ||
|
||
final EmailClient emailClient; | ||
|
||
@GetMapping("/email") | ||
void testEmail() { | ||
|
||
EmailDto email = new EmailDto(); | ||
email.setTo(List.of("email@local.com")); | ||
email.setFrom("email@local.com"); | ||
|
||
var filesBArray = new EmailDto.FileBArray[1]; | ||
for (int i = 0; i < 1; i++) { | ||
filesBArray[i] = new EmailDto.FileBArray("uplFile.getBytes()".getBytes(), "testfile.txt"); | ||
} | ||
email.setFiles(filesBArray); | ||
|
||
email.setSubject("hello"); | ||
email.setContent("hello"); | ||
emailClient.sendEmailWithAttachments(email); | ||
} | ||
} |
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
20 changes: 0 additions & 20 deletions
20
email-service/src/main/java/gt/mail/web/rest/EmailDto.java
This file was deleted.
Oops, something went wrong.
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