OutboundDocSubmissionFactory { public OrchestrationContextBuilder createOrchestrationContextBuilder(NhincConstants.GATEWAY_API_LEVEL apiLevel) { switch (apiLevel) { case LEVEL_g0: return new OutboundDocSubmissionOrchestrationContextBuilder_g0(); case LEVEL_g1: return new OutboundDocSubmissionOrchestrationContextBuilder_g1(); default: return new OutboundDocSubmissionOrchestrationContextBuilder_g0(); } } private  OutboundDocSubmissionFactory(); OrchestrationContextBuilder createOrchestrationContextBuilder(NhincConstants.GATEWAY_API_LEVEL apiLevel); static OutboundDocSubmissionFactory getInstance();  }
@Test public void testCreateOrchestrationContextBuilder() { OutboundDocSubmissionFactory factory = OutboundDocSubmissionFactory.getInstance(); OrchestrationContextBuilder contextBuilder = factory.createOrchestrationContextBuilder(NhincConstants.GATEWAY_API_LEVEL.LEVEL_g0); assertTrue(contextBuilder instanceof OutboundDocSubmissionOrchestrationContextBuilder_g0); contextBuilder = factory.createOrchestrationContextBuilder(NhincConstants.GATEWAY_API_LEVEL.LEVEL_g1); assertTrue(contextBuilder instanceof OutboundDocSubmissionOrchestrationContextBuilder_g1); }