NdsBeisEsb/src/test/java/com/northgateps/nds/beis/esb/viewdocument/viewDocumentRouteTest.java
//test to view the green deal pdf
test to view the green deal pdf
test to view the green deal pdf
@Test
    public void testViewPdfSuccessPath() throws Exception {
        logger.info("ViewDocumentGdipgdarRoute test started");       
        context.getRouteDefinition(routeNameUnderTest).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveAddLast().to(MOCK_VIEW_DOCUMENT_RESPONSE_CHECK);
                replaceFromWith(TEST_START_NAME);
                interceptSendToEndpoint(SKIP_EndPoint).skipSendToOriginalEndpoint().to(
                        MOCK_VIEW_DOCUMENT_REQUEST_CHECK).process(new Processor() {
                    @Override
                    public void process(Exchange exchange) throws Exception {
                        ViewPdfResponse appResponse = createViewPdfResponse();
                        exchange.getIn().setBody(appResponse);
                    }
                });
            }
        });
        context.start();
        ViewPdfNdsResponse response = (ViewPdfNdsResponse) apiEndpoint.requestBody(
                createNewViewPdfRequest());
        assertTrue(response.isSuccess());
        assertNotNull(response.getDocument());
        assertFalse(response.getSuperseded());
        assertMockEndpointsSatisfied();
    }
@ Test public void testViewPdfSuccessPath ( ) throws Exception { logger . info ( "ViewDocumentGdipgdarRoute test started" ) ; context . getRouteDefinition ( routeNameUnderTest ) . adviceWith ( context , new AdviceWithRouteBuilder ( ) { @ Override public void configure ( ) throws Exception { weaveAddLast ( ) . to ( MOCK_VIEW_DOCUMENT_RESPONSE_CHECK ) ; replaceFromWith ( TEST_START_NAME ) ; interceptSendToEndpoint ( SKIP_EndPoint ) . skipSendToOriginalEndpoint ( ) . to ( MOCK_VIEW_DOCUMENT_REQUEST_CHECK ) . process ( new Processor ( ) { @ Override public void process ( Exchange exchange ) throws Exception { ViewPdfResponse appResponse = createViewPdfResponse ( ) ; exchange . getIn ( ) . setBody ( appResponse ) ; } } ) ; } } ) ; context . start ( ) ; ViewPdfNdsResponse response = ( ViewPdfNdsResponse ) apiEndpoint . requestBody ( createNewViewPdfRequest ( ) ) ; assertTrue ( response . isSuccess ( ) ) ; assertNotNull ( response . getDocument ( ) ) ; assertFalse ( response . getSuperseded ( ) ) ; assertMockEndpointsSatisfied ( ) ; }
test to view the green deal pdf
test to view the green deal pdf