In this test, still fresh, we see some tests on a fresh BaseProductBean.
Most of this is rather expected, standard checking of known/expected values.
But the Diffblue-thing really goes to town on the colors - brighter(), darker(), colorSpace - everything is included… even recursive!
I recently came across some testMethod on a small dummy class containing a swing-control - it tested the complete inner working of a swing JTextField control!
IIRC, that method was marked as ‘partial test’ - but this BaseProductBean constructor test isnt.
Maybe you could tame the test generator a little bit when it comes to looking into the inner working of the Java runtime libraries.
/**
* Method under test: {@link BaseProductBean#BaseProductBean()}
*/
@Test
void testNewBaseProductBean() {
// Arrange and Act
BaseProductBean actualBaseProductBean = new BaseProductBean();
// Assert
assertEquals("", actualBaseProductBean.getBezeichnung());
assertEquals("", actualBaseProductBean.getUnStoffGruppe());
assertEquals("", actualBaseProductBean.getUnStoffKlasse());
UIProductGroup uiProductGroup = actualBaseProductBean.productGroup;
assertEquals("", uiProductGroup.getLangInfo());
BaseProductShortNameType shortName = actualBaseProductBean.getShortName();
assertEquals("", shortName.getValue());
assertEquals("", shortName.toString());
HGMBaseProductIdType baseProductId = actualBaseProductBean.getBaseProductId();
assertEquals("", baseProductId.getValue());
assertEquals("", baseProductId.toString());
UIRecStatus recStatus = actualBaseProductBean.getRecStatus();
assertEquals("", recStatus.getMdfyUser());
assertEquals("", actualBaseProductBean.bezeichnung);
assertEquals("0", actualBaseProductBean.getAdditivGrp());
assertEquals("00 - Dummy", uiProductGroup.getCaption());
assertEquals("00", actualBaseProductBean.getSPSCode());
assertEquals("00", uiProductGroup.getProductGroup());
assertEquals("0000", actualBaseProductBean.getUnStoffNr());
assertEquals("3 b", actualBaseProductBean.getStoffZiffer());
assertEquals("?UK?", actualBaseProductBean.getUltraKurzName());
assertEquals("B", actualBaseProductBean.getMinOelGrp());
assertEquals("BaseProduct", actualBaseProductBean.getClassName());
assertEquals("BaseProductId", baseProductId.getClassName());
assertEquals("BaseProductShortName", shortName.getClassName());
assertEquals("Dummy", uiProductGroup.getKurzInfo());
assertEquals("ProductGroup", uiProductGroup.getClassName());
assertNull(actualBaseProductBean.getWorkObjFromProxy());
assertNull(actualBaseProductBean.getPrimKey());
assertEquals(-1, actualBaseProductBean.getRowNum());
Color color = actualBaseProductBean.backColor;
assertEquals(-1, color.getRGB());
Color darkerResult = color.darker();
Color darkerResult2 = darkerResult.darker();
Color darkerResult3 = darkerResult2.darker();
assertEquals(-11119018, darkerResult3.getRGB());
Color darkerResult4 = darkerResult3.darker();
assertEquals(-12829636, darkerResult4.getRGB());
Color color2 = actualBaseProductBean.foreColor;
Color brighterResult = color2.brighter();
Color brighterResult2 = brighterResult.brighter();
Color brighterResult3 = brighterResult2.brighter();
Color brighterResult4 = brighterResult3.brighter();
assertEquals(-16316665, brighterResult4.getRGB());
assertEquals(-16448251, brighterResult3.getRGB());
assertEquals(-16514044, brighterResult2.getRGB());
assertEquals(-16579837, brighterResult.getRGB());
Color darkerResult5 = brighterResult.darker();
assertEquals(-16645630, darkerResult5.getRGB());
Color darkerResult6 = darkerResult5.darker();
assertEquals(-16711423, darkerResult6.getRGB());
assertEquals(-16777216, color2.getRGB());
Color brighterResult5 = darkerResult.brighter();
Color darkerResult7 = brighterResult5.darker();
Color brighterResult6 = darkerResult7.brighter();
assertEquals(-197380, brighterResult6.getRGB());
assertEquals(-5066062, darkerResult.getRGB());
assertEquals(-5131855, darkerResult7.getRGB());
assertEquals(-65794, brighterResult5.getRGB());
assertEquals(-8618884, darkerResult2.getRGB());
Color darkerResult8 = darkerResult7.darker();
assertEquals(-8684677, darkerResult8.getRGB());
Color brighterResult7 = darkerResult3.brighter();
assertEquals(-8750470, brighterResult7.getRGB());
assertEquals(0, color2.getBlue());
assertEquals(0, color2.getGreen());
assertEquals(0, color2.getRed());
assertEquals(1, darkerResult6.getBlue());
assertEquals(1, darkerResult6.getGreen());
assertEquals(1, darkerResult6.getRed());
assertEquals(1, brighterResult4.getTransparency());
assertEquals(1, brighterResult3.getTransparency());
assertEquals(1, brighterResult2.getTransparency());
assertEquals(1, brighterResult6.getTransparency());
assertEquals(1, brighterResult7.getTransparency());
assertEquals(1, brighterResult5.getTransparency());
assertEquals(1, brighterResult.getTransparency());
assertEquals(1, darkerResult7.getTransparency());
assertEquals(1, darkerResult5.getTransparency());
assertEquals(1, darkerResult8.getTransparency());
assertEquals(1, darkerResult6.getTransparency());
assertEquals(1, darkerResult4.getTransparency());
assertEquals(1, darkerResult3.getTransparency());
assertEquals(1, darkerResult2.getTransparency());
assertEquals(1, darkerResult.getTransparency());
assertEquals(1, color.getTransparency());
assertEquals(1, color2.getTransparency());
assertEquals(122, brighterResult7.getBlue());
assertEquals(122, brighterResult7.getGreen());
assertEquals(122, brighterResult7.getRed());
assertEquals(123, darkerResult8.getBlue());
assertEquals(123, darkerResult8.getGreen());
assertEquals(123, darkerResult8.getRed());
assertEquals(124, darkerResult2.getBlue());
assertEquals(124, darkerResult2.getGreen());
assertEquals(124, darkerResult2.getRed());
assertEquals(177, darkerResult7.getBlue());
assertEquals(177, darkerResult7.getGreen());
assertEquals(177, darkerResult7.getRed());
assertEquals(178, darkerResult.getBlue());
assertEquals(178, darkerResult.getGreen());
assertEquals(178, darkerResult.getRed());
assertEquals(2, darkerResult5.getBlue());
assertEquals(2, darkerResult5.getGreen());
assertEquals(2, darkerResult5.getRed());
assertEquals(252, brighterResult6.getBlue());
assertEquals(252, brighterResult6.getGreen());
assertEquals(252, brighterResult6.getRed());
assertEquals(254, brighterResult5.getBlue());
assertEquals(254, brighterResult5.getGreen());
assertEquals(254, brighterResult5.getRed());
assertEquals(255, brighterResult4.getAlpha());
assertEquals(255, brighterResult3.getAlpha());
assertEquals(255, brighterResult2.getAlpha());
assertEquals(255, brighterResult6.getAlpha());
assertEquals(255, brighterResult7.getAlpha());
assertEquals(255, brighterResult5.getAlpha());
assertEquals(255, brighterResult.getAlpha());
assertEquals(255, darkerResult7.getAlpha());
assertEquals(255, darkerResult5.getAlpha());
assertEquals(255, darkerResult8.getAlpha());
assertEquals(255, darkerResult6.getAlpha());
assertEquals(255, darkerResult4.getAlpha());
assertEquals(255, darkerResult3.getAlpha());
assertEquals(255, darkerResult2.getAlpha());
assertEquals(255, darkerResult.getAlpha());
assertEquals(255, color.getAlpha());
assertEquals(255, color2.getAlpha());
assertEquals(255, color.getBlue());
assertEquals(255, color.getGreen());
assertEquals(255, color.getRed());
assertEquals(3, brighterResult.getBlue());
assertEquals(3, brighterResult.getGreen());
assertEquals(3, brighterResult.getRed());
ColorSpace colorSpace = color.getColorSpace();
assertEquals(3, colorSpace.getNumComponents());
assertEquals(4, brighterResult2.getBlue());
assertEquals(4, brighterResult2.getGreen());
assertEquals(4, brighterResult2.getRed());
assertEquals(5, brighterResult3.getBlue());
assertEquals(5, brighterResult3.getGreen());
assertEquals(5, brighterResult3.getRed());
assertEquals(5, colorSpace.getType());
assertEquals(60, darkerResult4.getBlue());
assertEquals(60, darkerResult4.getGreen());
assertEquals(60, darkerResult4.getRed());
assertEquals(7, brighterResult4.getBlue());
assertEquals(7, brighterResult4.getGreen());
assertEquals(7, brighterResult4.getRed());
assertEquals(86, darkerResult3.getBlue());
assertEquals(86, darkerResult3.getGreen());
assertEquals(86, darkerResult3.getRed());
assertFalse(actualBaseProductBean.getFlagA1());
assertFalse(actualBaseProductBean.getFlagA3());
assertFalse(actualBaseProductBean.getFlagAlkohol());
assertFalse(actualBaseProductBean.getFlagE85());
assertFalse(actualBaseProductBean.getFlagGTL());
assertFalse(actualBaseProductBean.getIsHeizOel());
assertFalse(baseProductId.isDiesel());
assertFalse(baseProductId.isPalmOel());
assertFalse(baseProductId.isS98());
assertFalse(baseProductId.isSK());
assertFalse(recStatus.getLocked());
assertFalse(actualBaseProductBean.getIsGesperrt());
assertFalse(actualBaseProductBean.getTraceMethodCalls());
assertFalse(actualBaseProductBean.isInTransaction());
assertTrue(colorSpace.isCS_sRGB());
assertEquals(brighterResult2.darker(), brighterResult2.darker());
Color color3 = actualBaseProductBean.backColor;
assertEquals(color3, brighterResult5.brighter());
assertEquals(color3, color.brighter());
Color color4 = actualBaseProductBean.foreColor;
assertEquals(color4, darkerResult6.darker());
assertEquals(color4, color2.darker());
DensityType densityType = actualBaseProductBean.loadDensityMax;
assertEquals(densityType, actualBaseProductBean.maxDensity);
DensityType densityType2 = actualBaseProductBean.loadDensityMin;
assertEquals(densityType2, actualBaseProductBean.minDensity);
Date expectedMdfyDate = recStatus.getLastUsed();
assertSame(expectedMdfyDate, recStatus.getMdfyDate());
DensityType avgDensity = actualBaseProductBean.getAvgDensity();
Number expectedValue = avgDensity.getValue();
assertSame(expectedValue, actualBaseProductBean.avgDensity.getValue());
DensityType loadDensityMax = actualBaseProductBean.getLoadDensityMax();
Number expectedValue2 = loadDensityMax.getValue();
assertSame(expectedValue2, actualBaseProductBean.loadDensityMax.getValue());
DensityType loadDensityMin = actualBaseProductBean.getLoadDensityMin();
Number expectedValue3 = loadDensityMin.getValue();
assertSame(expectedValue3, actualBaseProductBean.loadDensityMin.getValue());
assertSame(colorSpace, brighterResult4.getColorSpace());
assertSame(colorSpace, brighterResult3.getColorSpace());
assertSame(colorSpace, brighterResult2.getColorSpace());
assertSame(colorSpace, brighterResult6.getColorSpace());
assertSame(colorSpace, brighterResult7.getColorSpace());
assertSame(colorSpace, brighterResult5.getColorSpace());
assertSame(colorSpace, brighterResult.getColorSpace());
assertSame(colorSpace, darkerResult7.getColorSpace());
assertSame(colorSpace, darkerResult5.getColorSpace());
assertSame(colorSpace, darkerResult8.getColorSpace());
assertSame(colorSpace, darkerResult6.getColorSpace());
assertSame(colorSpace, darkerResult4.getColorSpace());
assertSame(colorSpace, darkerResult3.getColorSpace());
assertSame(colorSpace, darkerResult2.getColorSpace());
assertSame(colorSpace, darkerResult.getColorSpace());
assertSame(colorSpace, color2.getColorSpace());
assertSame(actualBaseProductBean.avgDensity, avgDensity);
assertSame(densityType, loadDensityMax);
assertSame(densityType2, loadDensityMin);
DensityType expectedMaxDensity = actualBaseProductBean.maxDensity;
assertSame(expectedMaxDensity, actualBaseProductBean.getMaxDensity());
DensityType expectedMinDensity = actualBaseProductBean.minDensity;
assertSame(expectedMinDensity, actualBaseProductBean.getMinDensity());
UIProductGroup expectedProductGroup = actualBaseProductBean.productGroup;
assertSame(expectedProductGroup, actualBaseProductBean.getProductGroup());
}