@@ -0,0 +1,2628 @@
+/*%0A * Copyright 2016 Red Hat, Inc. and/or its affiliates.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.drools.workbench.screens.guided.dtable.client.widget.table.utilities;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Matchers.anyString;%0Aimport static org.mockito.Mockito.never;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport org.drools.workbench.models.datamodel.oracle.DataType;%0Aimport org.drools.workbench.models.guided.dtable.shared.model.BaseColumn;%0Aimport org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52;%0Aimport org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;%0Aimport org.drools.workbench.models.guided.dtable.shared.model.Pattern52;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class ColumnUtilitiesTest %7B%0A%0A    @Mock%0A    GuidedDecisionTable52 model;%0A    @Mock%0A    AsyncPackageDataModelOracle oracle;%0A%0A    Pattern52 pattern;%0A    ConditionCol52 column;%0A    ColumnUtilities utilities;%0A%0A    @Before%0A    public void setUp() %7B%0A        utilities = new ColumnUtilities(model, oracle);%0A        pattern = new Pattern52();%0A        column = new ConditionCol52();%0A        when(model.getPattern(column)).thenReturn(pattern);%0A    %7D%0A%0A    @Test%0A    public void getTypeSafeType_operatorIn() %7B%0A        column.setOperator(%22in%22);%0A        check();%0A    %7D%0A%0A    @Test%0A    public void getTypeSafeType_operatorNotIn() %7B%0A        column.setOperator(%22not in%22);%0A        check();%0A    %7D%0A%0A    private void check() %7B%0A        assertEquals(DataType.DataTypes.STRING, utilities.getTypeSafeType(pattern, column));%0A        assertEquals(DataType.DataTypes.STRING, utilities.getTypeSafeType((BaseColumn)column));%0A        assertEquals(DataType.TYPE_STRING, utilities.getType((BaseColumn)column));%0A        verify(oracle, never()).getFieldType(anyString(), anyString());%0A    %7D%0A%7D

Add a test for RHBRMS-1841. (#223)