### Question:
CorbaDSIServant extends DynamicImplementation { public void invoke(ServerRequest request) throws CorbaBindingException { String opName = request.operation(); QName requestOperation = operationMap.get(opName); MessageImpl msgImpl = new MessageImpl(); msgImpl.setDestination(getDestination()); Exchange exg = new ExchangeImpl(); exg.put(String.class, requestOperation.getLocalPart()); exg.put(ORB.class, getOrb()); exg.put(ServerRequest.class, request); msgImpl.setExchange(exg); CorbaMessage msg = new CorbaMessage(msgImpl); msg.setCorbaTypeMap(typeMap); BindingMessageInfo bindingMsgOutputInfo = null; BindingOperationInfo bindingOpInfo = null; try { bindingOpInfo = this.destination.getEndPointInfo().getBinding().getOperation(requestOperation); } catch (Exception ex) { throw new CorbaBindingException("Invalid Request. Operation unknown: " + opName); } if (bindingOpInfo != null) { bindingMsgOutputInfo = bindingOpInfo.getOutput(); if (bindingMsgOutputInfo == null) { exg.setOneWay(true); } } getObserver().onMessage(msg); } CorbaDSIServant(); void init(ORB theOrb,
                     POA poa,
                     CorbaDestination dest,
                     MessageObserver observer); void init(ORB theOrb,
                     POA poa,
                     CorbaDestination dest,
                     MessageObserver observer,
                     CorbaTypeMap map); MessageObserver getObserver(); void setObserver(MessageObserver observer); ORB getOrb(); CorbaDestination getDestination(); Map<String, QName> getOperationMapping(); void setOperationMapping(Map<String, QName> map); void setCorbaTypeMap(CorbaTypeMap map); void invoke(ServerRequest request); String[] _all_interfaces(POA poa, byte[] objectId); POA _default_POA();  }### Answer:
@Test public void testInvoke() throws Exception { CorbaDestination dest = new TestUtils().getComplexTypesTestDestination(); CorbaDSIServant dsiServant = new CorbaDSIServant(); dsiServant.init(orb, null, dest, null); ServerRequest request = new ServerRequest() { public String operation() { return "greetMe"; } public Context ctx() { return null; } }; MessageObserver incomingObserver = new TestObserver(); dsiServant.setObserver(incomingObserver); Map<String, QName> map = new HashMap<>(2); map.put("greetMe", new QName("greetMe")); dsiServant.setOperationMapping(map); dsiServant.invoke(request); }
@Test public void testInvoke() throws Exception { CorbaDestination dest = new TestUtils().getComplexTypesTestDestination(); CorbaDSIServant dsiServant = new CorbaDSIServant(); dsiServant.init(orb, null, dest, null); ServerRequest request = new ServerRequest() { public String operation() { return "greetMe"; } public Context ctx() { return null; } }; MessageObserver incomingObserver = new TestObserver(); dsiServant.setObserver(incomingObserver); Map<String, QName> map = new HashMap<String, QName>(2); map.put("greetMe", new QName("greetMe")); dsiServant.setOperationMapping(map); dsiServant.invoke(request); }