@Test(timeout = 30000)
public void testInitializationWithPluggableDeviceFrameworkEnabled2()
    throws ClassNotFoundException {

  ResourcePluginManager rpm = new ResourcePluginManager();
  ResourcePluginManager rpmSpy = spy(rpm);
  nm = new ResourcePluginMockNM(rpmSpy);
  boolean fail = false;
  try {
    conf.setBoolean(YarnConfiguration.NM_PLUGGABLE_DEVICE_FRAMEWORK_ENABLED,
        true);
    nm.init(conf);
    nm.start();
  } catch (YarnRuntimeException e) {
    fail = true;
  } catch (Exception ignored) {
    // ignore
  }
  verify(rpmSpy).initializePluggableDevicePlugins(
      any(Context.class), any(Configuration.class), anyMap());
  assertThat(fail).isTrue();
}