Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty message in ScdException in AbstractDataAttributeAdapter.check #353

Open
massifben opened this issue Nov 30, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@massifben
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

1 participant