-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from pzygielo/message
Fix NullPointerException on null outcome
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 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
22 changes: 22 additions & 0 deletions
22
impl/src/test/java/org/glassfish/soteria/cdi/AnnotationELPProcessorTest.java
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,22 @@ | ||
package org.glassfish.soteria.cdi; | ||
|
||
import static org.junit.Assert.*; | ||
import org.junit.Test; | ||
|
||
public class AnnotationELPProcessorTest { | ||
@Test | ||
public void shouldBuildExpectedMessageForNullOutcome() { | ||
String msg = AnnotationELPProcessor.buildNonBooleanOutcomeMessage(null, "abc"); | ||
|
||
assertEquals("Expression abc should evaluate to boolean but evaluated to null", msg); | ||
} | ||
|
||
@Test | ||
public void shouldBuildExpectedMessageForNonBooleanOutcome() { | ||
String msg = AnnotationELPProcessor.buildNonBooleanOutcomeMessage(1, "ijk"); | ||
|
||
assertEquals("Expression ijk should evaluate to boolean but evaluated to class java.lang.Integer 1", msg); | ||
} | ||
|
||
} | ||
|