public DataSetDef clone() { DataSetDef def = new DataSetDef(); clone(def); return def; }
public DataSetDef clone() { DataSetDef def = new DataSetDef(); clone(def); return def; }
@Before public void setup() throws Exception { when(dataSetDef.getUUID()).thenReturn("uuid1"); when(dataSetDef.getName()).thenReturn("name1"); when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.BEAN); when(columnDefList.isEmpty()).thenReturn(true); when(dataSetDef.clone()).thenReturn(dataSetDef); tested = new DataSetDefPreviewTable(displayerLocator, clientServices, view); }
@Test public void testDoTestDataSet() throws Exception { final DataSetEditorWorkflow.TestDataSetCallback testDataSetCallback = mock(DataSetEditorWorkflow.TestDataSetCallback.class); presenter.testDataSet(testDataSetCallback); verify(dataSetDef, times(1)).setAllColumnsEnabled(true); verify(dataSetDef, times(1)).setColumns(null); verify(dataSetDef, times(1)).setDataSetFilter(null); verify(dataSetDef, times(1)).clone(); verify(dataSetDef, times(1)).setCacheEnabled(false); verify(testDataSetCallback, times(1)).onSuccess(dataSet); verify(testDataSetCallback, times(0)).onError(any(ClientRuntimeError.class)); verify(view, times(0)).init(presenter); verify(view, times(0)).add(any(IsWidget.class)); verify(view, times(0)).addButton(anyString(), anyString(), anyBoolean(), any(Command.class)); verify(view, times(0)).clearButtons(); verify(view, times(0)).clearView(); }
@Before public void setup() throws Exception { super.setup(); presenter = new DataSetEditorWorkflow(clientServices, validatorProvider, beanManager, saveRequestEvent, testDataSetEvent, cancelRequestEvent, view) { }; presenter.dataSetDef = this.dataSetDef; when(dataSetDef.getUUID()).thenReturn(UUID); when(dataSetDef.getName()).thenReturn(NAME); when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.BEAN); when(dataSet.getUUID()).thenReturn(UUID); when(dataSet.getRowCount()).thenReturn(0); when(dataSetDef.clone()).thenReturn(dataSetDef); doAnswer(new Answer<Void>() { @Override public Void answer(final InvocationOnMock invocationOnMock) throws Throwable { DataSetReadyCallback callback = (DataSetReadyCallback) invocationOnMock.getArguments()[2]; callback.callback(dataSet); return null; } }).when(clientServices).lookupDataSet(any(dataSetDef.getClass()), any(DataSetLookup.class), any(DataSetReadyCallback.class)); }
when( dataSet.getUUID() ).thenReturn( UUID ); when( dataSet.getRowCount() ).thenReturn( 0 ); when( dataSetDef.clone() ).thenReturn( dataSetDef ); when( editor.refreshEditor() ).thenReturn( refreshEditor );
DataSetDef cloned = def.clone();
DataSetDef cloned = def.clone();
String subjectId, String message) { DataSetDef clone = def.clone(); clone.setUUID(uuidGenerator.newUuid()); clone.setName(newName);
String subjectId, String message) { DataSetDef clone = def.clone(); clone.setUUID(uuidGenerator.newUuid()); clone.setName(newName);
DataSetDef editCloneWithoutCacheSettings = dataSetDef.clone(); editCloneWithoutCacheSettings.setCacheEnabled(false);
DataSetDef editCloneWithoutCacheSettings = dataSetDef.clone(); editCloneWithoutCacheSettings.setCacheEnabled(false);
getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false);
getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false);