-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test case, which explains the problem inside getMockEndpoint
- Loading branch information
Arsen A. Gutsal
committed
Oct 3, 2013
1 parent
bc5c728
commit 62879c9
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package grails.routing | ||
|
||
import static org.junit.Assert.* | ||
import org.junit.* | ||
|
||
import org.apache.camel.test.junit4.CamelTestSupport | ||
import org.apache.camel.builder.RouteBuilder | ||
|
||
class RoutesTests extends CamelTestSupport { | ||
|
||
def camelContext | ||
def producerTemplate | ||
|
||
@Before | ||
void setUp() { | ||
super.setUp() | ||
|
||
camelContext.addRoutes( | ||
new RouteBuilder(){ | ||
@Override | ||
void configure(){ | ||
from('direct:foo').to('mock:bar') | ||
} | ||
}) | ||
} | ||
|
||
@After | ||
void tearDown() { | ||
camelContext.stop() | ||
} | ||
|
||
@Test | ||
void testSimpleRoute() { | ||
def mockEndpoint | ||
mockEndpoint = camelContext.getEndpoint('mock:bar') | ||
//mockEndpoint = getMockEndpoint('mock:bar') | ||
|
||
mockEndpoint.expectedMessageCount(1) | ||
|
||
producerTemplate.sendBody('direct:foo', 'Hello World') | ||
|
||
mockEndpoint.assertIsSatisfied() | ||
} | ||
} |