This repository has been archived by the owner on Aug 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for ComponentDestinationTest.java
- Loading branch information
Zeeshan Ghalib
committed
Feb 29, 2016
1 parent
0e83ba3
commit 19e04fc
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
core/src/test/java/uk/gov/justice/services/core/sender/ComponentDestinationTest.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,33 @@ | ||
package uk.gov.justice.services.core.sender; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import uk.gov.justice.services.core.annotation.Component; | ||
|
||
import static org.hamcrest.CoreMatchers.equalTo; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class ComponentDestinationTest { | ||
|
||
private ComponentDestination componentDestination; | ||
|
||
@Before | ||
public void setup() { | ||
componentDestination = new ComponentDestination(); | ||
} | ||
|
||
@Test | ||
public void shouldReturnCommandController() throws Exception { | ||
assertThat(componentDestination.getDefault(Component.COMMAND_API), equalTo(Component.COMMAND_CONTROLLER)); | ||
} | ||
|
||
@Test | ||
public void shouldReturnCommandHandler() throws Exception { | ||
assertThat(componentDestination.getDefault(Component.COMMAND_CONTROLLER), equalTo(Component.COMMAND_HANDLER)); | ||
} | ||
|
||
@Test(expected = IllegalArgumentException.class) | ||
public void shouldThrowExceptionOnComponentWithNoDefaultDestination() throws Exception { | ||
componentDestination.getDefault(Component.COMMAND_HANDLER); | ||
} | ||
} |