@Test public void forDatabaseThrowsForInvalidClassName() { assertThatThrownBy(() -> KeyValueServiceInstrumentation.forDatabase("FAKE_BACKEND")) .isExactlyInstanceOf(IllegalArgumentException.class) .hasMessage("Exception trying to instantiate class FAKE_BACKEND"); }
public static KeyValueServiceInstrumentation forDatabase(String backend) throws IllegalArgumentException { if (classNames.containsKey(backend)) { return backendMap.get(classNames.get(backend)); } else { return forClass(backend); } }
KeyValueServiceInstrumentation { public static KeyValueServiceInstrumentation forDatabase(String backend) throws IllegalArgumentException { if (classNames.containsKey(backend)) { return backendMap.get(classNames.get(backend)); } else { return forClass(backend); } } }
KeyValueServiceInstrumentation { public static KeyValueServiceInstrumentation forDatabase(String backend) throws IllegalArgumentException { if (classNames.containsKey(backend)) { return backendMap.get(classNames.get(backend)); } else { return forClass(backend); } } KeyValueServiceInstrumentation(int kvsPort, String dockerComposeFileName); }
KeyValueServiceInstrumentation { public static KeyValueServiceInstrumentation forDatabase(String backend) throws IllegalArgumentException { if (classNames.containsKey(backend)) { return backendMap.get(classNames.get(backend)); } else { return forClass(backend); } } KeyValueServiceInstrumentation(int kvsPort, String dockerComposeFileName); String getDockerComposeResourceFileName(); int getKeyValueServicePort(); abstract KeyValueServiceConfig getKeyValueServiceConfig(InetSocketAddress addr); abstract boolean canConnect(InetSocketAddress addr); static void addNewBackendType(KeyValueServiceInstrumentation backend); static KeyValueServiceInstrumentation forDatabase(String backend); static Set<String> getBackends(); @Override abstract String toString(); String getClassName(); }
KeyValueServiceInstrumentation { public static KeyValueServiceInstrumentation forDatabase(String backend) throws IllegalArgumentException { if (classNames.containsKey(backend)) { return backendMap.get(classNames.get(backend)); } else { return forClass(backend); } } KeyValueServiceInstrumentation(int kvsPort, String dockerComposeFileName); String getDockerComposeResourceFileName(); int getKeyValueServicePort(); abstract KeyValueServiceConfig getKeyValueServiceConfig(InetSocketAddress addr); abstract boolean canConnect(InetSocketAddress addr); static void addNewBackendType(KeyValueServiceInstrumentation backend); static KeyValueServiceInstrumentation forDatabase(String backend); static Set<String> getBackends(); @Override abstract String toString(); String getClassName();  }