### Question:
SolaceTransport implements Transport { @Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } }  @Override void init(String configPath); @Override void start(); @Override void stop(); @Override void send(Cdr msg); @Override void send(Cdr msg, String topicName); @Override boolean isLoggedOn(); @Override String getDefaultSessionId(); @Override void setTransportDelegate(TransportDelegate<String, Cdr> transDel); @Override @SuppressWarnings("unchecked") void setCodec(Codec c); @Override Codec getCodec(); @Override void setDelegate(ClientDelegate delegate); @Override ClientDelegate getDelegate();  }### Answer:
@Test public void testInit() throws EtiqetException { transport.init("src/test/resources/config/solace.cfg"); SolXAConnectionFactory connectionFactory = transport.getConnectionFactory(); assertNotNull("Connection Factory should exist after transport is initialised", connectionFactory); assertEquals("tcp: assertEquals("default", connectionFactory.getVPN()); assertEquals("USERNAME", connectionFactory.getUsername()); assertEquals("PASSWORD", connectionFactory.getPassword()); assertEquals("testTopic", transport.getDefaultSessionId()); }
@Test public void testInit_PropertiesNotFound() { String configPath = "src/test/resources/config/solace_config_not_found.cfg"; try { transport.init(configPath); fail("Should have failed because the above config file shouldn't exist"); } catch (Exception e) { assertTrue(e instanceof EtiqetException); assertEquals("Could not init Solace with config [" + configPath + "]", e.getMessage()); } }