Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
added ctor overload for breadcrumb message (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored and bruno-garcia committed Dec 9, 2019
1 parent c10435c commit 6da139a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sentry-core/src/main/java/io/sentry/core/Breadcrumb.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public Breadcrumb() {
this(DateUtils.getCurrentDateTime());
}

public Breadcrumb(String message) {
this();
this.message = message;
}

public Date getTimestamp() {
return (Date) timestamp.clone();
}
Expand Down
6 changes: 6 additions & 0 deletions sentry-core/src/test/java/io/sentry/core/BreadcrumbTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,10 @@ class BreadcrumbTest {
val breadcrumb = Breadcrumb()
assertNotNull(breadcrumb.timestamp)
}

@Test
fun `breadcrumb takes message on ctor`() {
val breadcrumb = Breadcrumb("this is a test")
assertEquals("this is a test", breadcrumb.message)
}
}

0 comments on commit 6da139a

Please sign in to comment.