### Question:
ServiceInstanceWrapper { public ServiceProxy getTransportServiceProxy() throws ServiceProxyNotFoundException { ServiceProxy serviceProxy = null; for (ServiceProxy sp : serviceInstance.getServiceProxies()) { if (SERVICE_PROXY_TRANSPORT.equalsIgnoreCase(sp.getType())) { serviceProxy = sp; break; } } if (serviceProxy == null) { throw new ServiceProxyNotFoundException("Transport Service Proxy not found for service instance: " + serviceInstance.getServiceInstanceId()); } return serviceProxy; } ServiceInstanceWrapper(ServiceInstance serviceInstance); ServiceProxy getTransportServiceProxy();  }### Answer:
@Test public void getTransportServiceProxyTest() throws ServiceProxyNotFoundException { ServiceInstance si = buildServiceInstance(); si.getServiceProxies().add(buildServiceProxy()); ServiceInstanceWrapper sw = new ServiceInstanceWrapper(si); ServiceProxy sp = sw.getTransportServiceProxy(); assertEquals("sp-001", sp.getId()); assertEquals("transport", sp.getType()); }
@Test public void getTransportServiceProxyExceptionTest() throws ServiceProxyNotFoundException { expectedException.expect(ServiceProxyNotFoundException.class); ServiceInstanceWrapper sw = new ServiceInstanceWrapper(buildServiceInstance()); sw.getTransportServiceProxy(); }