@Test public void testBuildNestedBuilder2() throws Exception { contextMetaBuilder.setRootURI(contextMetaBuilder.getRootURI() + "Engine"); contextMetaBuilder.addService( serviceMetaBuilder() .setName("myService") .addRequestPath("/myservice") .addMethod( serviceMethodMetaBuilder().setName("hello") .addRequestEndpoint(getRequest( "/callme/", stringParam( headParam("foobarHeader") ), intParam( requestParam("helloMom") ), doubleParam( pathParam("score", 9) ) )).build() ) .build()); contextMetaBuilder.setServices(contextMetaBuilder.getServices()); ContextMeta context = contextMetaBuilder.build(); assertEquals("hello", context.getServices().get(0).getMethods().get(0).getName()); assertEquals("/callme/", context.getServices() .get(0).getMethods().get(0).getRequestEndpoints().get(0).getRequestURI()); }
@Test public void testBuildNestedBuilder3() throws Exception { contextMetaBuilder.setRootURI(contextMetaBuilder.getRootURI() + "Engine"); contextMetaBuilder.addService( serviceMetaBuilder() .setName("myService") .addRequestPath("/myservice") .addMethod( serviceMethodMetaBuilder().setName("hello") .addRequestEndpoint( requestMetaBuilder().setRequestURI("/callme/").addParameters( stringParam( headParam("foobarHeader") ), intParam( requestParam("helloMom") ), doubleParam( pathParam("score", 9) ) ).build() ).build() ) .build()); contextMetaBuilder.setServices(contextMetaBuilder.getServices()); ContextMeta context = contextMetaBuilder.build(); assertEquals("hello", context.getServices().get(0).getMethods().get(0).getName()); assertEquals("/callme/", context.getServices() .get(0).getMethods().get(0).getRequestEndpoints().get(0).getRequestURI()); }