### Question:
ConnectorProviderBase extends ConnectorProvider implements AuditLoggingComponent { public Connector getConnector(Connection connection) throws ConnectionCheckedException, ConnectorCheckedException { return this.getConnector(new ConnectionProperties(connection)); } ConnectorProviderBase(); String getConnectorClassName(); void setAuditLog(AuditLog auditLog); ConnectorTypeProperties getConnectorTypeProperties(); ConnectorType getConnectorType(); Connector getConnector(Connection connection); Connector getConnector(ConnectionProperties connection); int hashCode(); @Override boolean equals(Object object); @Override String toString();  }### Answer:
@Test public void testNullConnection() { MockConnectorProvider testObject = new MockConnectorProvider(); try { testObject.getConnector((Connection)null); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-001 Null connection object passed on request for new connector instance")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testNullConnectionProperties() { MockConnectorProvider testObject = new MockConnectorProvider(); try { testObject.getConnector((ConnectionProperties)null); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-001 Null connection object passed on request for new connector instance")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testEmptyConnection() { MockConnectorProvider testObject = new MockConnectorProvider(); Connection testConnection = new Connection(null); try { testObject.getConnector(testConnection); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-003 Null connectorType property passed in connection <Unknown>")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testEmptyConnectionProperties() { MockConnectorProvider testObject = new MockConnectorProvider(); ConnectionProperties testConnection = new ConnectionProperties((Connection)null); try { testObject.getConnector(testConnection); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-003 Null connectorType property passed in connection <Unknown>")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testEmptyNamedConnection() { MockConnectorProvider testObject = new MockConnectorProvider(); Connection testConnection = new Connection(); testConnection.setQualifiedName("Test.Connection"); testConnection.setDisplayName("Test"); try { testObject.getConnector(testConnection); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-003 Null connectorType property passed in connection Test.Connection")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testEmptyNamedConnectionProperties() { MockConnectorProvider testObject = new MockConnectorProvider(); Connection testConnection = new Connection(); testConnection.setQualifiedName("Test.Connection"); testConnection.setDisplayName("Test"); ConnectionProperties testConnectionProperties = new ConnectionProperties(testConnection); try { testObject.getConnector(testConnectionProperties); } catch (ConnectionCheckedException chk) { assertTrue(chk.getMessage().contains("OCF-CONNECTION-400-003 Null connectorType property passed in connection Test.Connection")); } catch (Throwable exc) { assertTrue(false); } }
@Test public void testOKConnection() { MockConnectorProvider testObject = new MockConnectorProvider(); try { Connector newConnector = testObject.getConnector(getOKConnection(MockConnectorProvider.class.getName())); MockConnector mockConnector = (MockConnector)newConnector; assertTrue(mockConnector.getMockConnectorData().contains("This is from the mock connector")); assertTrue(mockConnector.getConnectedAssetProperties("TestUserId") == null); } catch (Throwable error) { assertTrue(false); } }
@Test public void testOKConnectionProperties() { MockConnectorProvider testObject = new MockConnectorProvider(); ConnectionProperties testConnectionProperties = new ConnectionProperties(getOKConnection(MockConnectorProvider.class.getName())); try { Connector newConnector = testObject.getConnector(testConnectionProperties); MockConnector mockConnector = (MockConnector)newConnector; assertTrue(mockConnector.getMockConnectorData().contains("This is from the mock connector")); assertTrue(mockConnector.getConnectedAssetProperties("TestUserId") == null); } catch (Throwable error) { assertTrue(false); } }