public void testSetGetProfile() throws Exception {
    ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
    assertEquals("", BootLaunchConfigurationDelegate.getProfile(wc));

    BootLaunchConfigurationDelegate.setProfile(wc, "deployment");
    assertEquals("deployment", BootLaunchConfigurationDelegate.getProfile(wc));

    BootLaunchConfigurationDelegate.setProfile(wc, null);
    assertEquals("", BootLaunchConfigurationDelegate.getProfile(wc));
  }
  public void testLaunchWithProfile() throws Exception {
    createLaunchReadyProject(TEST_PROJECT);
    ILaunchConfigurationWorkingCopy wc = createBaseWorkingCopy();

    BootLaunchConfigurationDelegate.setProfile(wc, "special");

    LaunchResult result = LaunchUtil.synchLaunch(wc);

    assertContains(":: Spring Boot ::", result.out);
    assertContains("foo='special foo'", result.out);
    assertOk(result);
  }
  private ILaunchConfigurationWorkingCopy createBaseWorkingCopy() throws Exception {
    ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
    BootLaunchConfigurationDelegate.setDefaults(wc, getProject(TEST_PROJECT), TEST_MAIN_CLASS);

    // Explictly set all options in the config to 'disabled' irrespective of
    // their default values (tests will be more robust w.r.t changing of the defaults).
    BootLaunchConfigurationDelegate.setEnableDebugOutput(wc, false);
    BootLaunchConfigurationDelegate.setEnableLiveBeanSupport(wc, false);
    BootLaunchConfigurationDelegate.setJMXPort(wc, "");
    BootLaunchConfigurationDelegate.setProfile(wc, "");
    BootLaunchConfigurationDelegate.setProperties(wc, null);
    return wc;
  }