@Test public void testTableScopeWithBadDelegate() throws Exception { expect(tableConf.getTableCustom(TABLE_CUSTOM_SUFFIX)).andReturn(null).once(); expect(systemConf.getCustom(getCustomPropertySuffix(ChooserScope.DEFAULT))) .andReturn("not a valid class name").once(); expect(serviceEnv.instantiate(TableId.of("testTable"), "not a valid class name", VolumeChooser.class)).andThrow(new RuntimeException()); replay(serviceEnv, tableConf, systemConf); assertThrows(VolumeChooserException.class, this::getTableDelegate); }
private static final String getCustomPropertySuffix(ChooserScope scope) { return "volume.chooser." + scope.name().toLowerCase(); }
PerTableVolumeChooser implements VolumeChooser { private static final String getCustomPropertySuffix(ChooserScope scope) { return "volume.chooser." + scope.name().toLowerCase(); } }
PerTableVolumeChooser implements VolumeChooser { private static final String getCustomPropertySuffix(ChooserScope scope) { return "volume.chooser." + scope.name().toLowerCase(); }  }
PerTableVolumeChooser implements VolumeChooser { private static final String getCustomPropertySuffix(ChooserScope scope) { return "volume.chooser." + scope.name().toLowerCase(); }  @Override String choose(VolumeChooserEnvironment env, Set<String> options); @Override Set<String> choosable(VolumeChooserEnvironment env, Set<String> options); }
PerTableVolumeChooser implements VolumeChooser { private static final String getCustomPropertySuffix(ChooserScope scope) { return "volume.chooser." + scope.name().toLowerCase(); }  @Override String choose(VolumeChooserEnvironment env, Set<String> options); @Override Set<String> choosable(VolumeChooserEnvironment env, Set<String> options);  }