Skip to content

Commit

Permalink
added test case, which explains the problem inside getMockEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Arsen A. Gutsal committed Oct 3, 2013
1 parent bc5c728 commit 62879c9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ grails.project.dependency.resolution = {
excludes 'spring-context', 'spring-aop', 'spring-tx', 'groovy-all'
}
compile("org.apache.camel:camel-stream:${camelVersion}")

test("org.apache.camel:camel-test:${camelVersion}") { excludes "junit" }
}

plugins {
Expand Down
44 changes: 44 additions & 0 deletions test/integration/grails/routing/RoutesTests.groovy
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()
}
}

0 comments on commit 62879c9

Please sign in to comment.