Skip to content

Empty message in ScdException in AbstractDataAttributeAdapter.check #353

@massifben

Description

@massifben

Subject of the issue

Method org.lfenergy.compas.sct.commons.scl.dtt.AbstractDataAttributeAdapter.check() throws a ScdException with empty message in case EnumType does not exist.

  • Version of CoMPAS : 0.2.16

Steps to reproduce

    @Test
    void myTest(){
        // Given
        TDataTypeTemplates tDataTypeTemplates = new TDataTypeTemplates();
        TDOType tdoType = new TDOType();
        TDA tda = new TDA();
        tda.setBType(TPredefinedBasicTypeEnum.ENUM);
        tda.setType("MyEnum");
        tdoType.getSDOOrDA().add(tda);
        tDataTypeTemplates.getDOType().add(tdoType);
        DAAdapter daAdapter = new DAAdapter(new DOTypeAdapter(new DataTypeTemplateAdapter(null, tDataTypeTemplates), tdoType), tda);

        // When & Then
        assertThatThrownBy(() -> daAdapter.check(new DaTypeName("toto")))
                .hasMessageMatching(".+");
    }

Expected behaviour

The test should succeed : the message of the exception should not be empty

Actual behaviour

The test fails : the message is an empty String

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To do

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions