summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilderTest.java
blob: 2a8cabbca8bb8e379c3ff8dc6b3d08e5c10f333c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package org.openecomp.sdc.versioning.errors;


import org.junit.Assert;
import org.junit.Test;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;

public class CheckoutOnLockedEntityErrorBuilderTest {
    @Test
    public void test() {
        CheckoutOnLockedEntityErrorBuilder builder = new CheckoutOnLockedEntityErrorBuilder("entityType",
                "entityId", "lockingUser");

        ErrorCode build = builder.build();
        Assert.assertEquals(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY, build.id() );
        Assert.assertEquals(ErrorCategory.APPLICATION, build.category() );
        Assert.assertEquals(String.format(CheckoutOnLockedEntityErrorBuilder.CHECKOT_ON_LOCKED_ENTITY_MSG,
                "entityType", "entityId", "lockingUser") ,  build.message());
    }

}