Removing comments from generated tests

By default the plugin generates tests containing comments which describe each section of the test. These comments can be hidden by ticking the Hide Comments box.

Open the IntelliJ IDEA -> Preferences (macOS) or File -> Settings (Windows/Linux) menu and navigate to the Diffblue Cover option under the Tools section. Under the Generation tab, check the Hide Comments box to prevent these comments from appearing.

If Hide Comments is not selected, the tests generated will look like this:

@Test
public void testhasItem() throws Exception {
  // Arrange
  Order order = new Order();

  // Act
  boolean actual = order.hasItem();

  // Assert
  boolean resultBoolean = false;
  assertEquals(resultBoolean, actual);
}

Where the test is arranged into two (or three without inlining) sections.

If Hide Comments is selected, the tests generated might look like this:

@Test
public void testhasItem() throws Exception {
  Order order = new Order();
  boolean actual = order.hasItem();
  boolean resultBoolean = false;
  assertEquals(resultBoolean, actual);
}

results matching ""

    No results matching ""