target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testComputeCoeffsFromOffsets() { CrossGeometry crossGeometry = new CrossGeometry(); crossGeometry.setPrfOriginal(prfERS); crossGeometry.setRsrOriginal(rsrERS); crossGeometry.setPrfTarget(prfASAR); crossGeometry.setRsrTarget(rsrASAR); crossGeometry.setDataWindow(new Window(lineLo, lineHi, pixelLo, pixe... | public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); for (int i = 0; i... | CrossGeometry { public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); f... | CrossGeometry { public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); f... | CrossGeometry { public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); f... | CrossGeometry { public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); f... |
@Ignore @Test public void testComputeCorners() throws Exception { long start = System.currentTimeMillis(); GeoPoint[] corners = GeoUtils.computeCorners(slcimage, orbit_ACTUAL, window, height); long stop = System.currentTimeMillis(); System.out.println("time = " + (double)(stop - start)/1000); Assert.assertEquals(corner... | public static GeoPoint[] computeCorners(final SLCImage meta, final Orbit orbit, final Window tile, final float height[]) throws Exception { if (height.length != 4) { throw new IllegalArgumentException("input height array has to have 4 elements"); } GeoPoint[] corners = new GeoPoint[2]; double[] phiAndLambda; final doub... | GeoUtils { public static GeoPoint[] computeCorners(final SLCImage meta, final Orbit orbit, final Window tile, final float height[]) throws Exception { if (height.length != 4) { throw new IllegalArgumentException("input height array has to have 4 elements"); } GeoPoint[] corners = new GeoPoint[2]; double[] phiAndLambda;... | GeoUtils { public static GeoPoint[] computeCorners(final SLCImage meta, final Orbit orbit, final Window tile, final float height[]) throws Exception { if (height.length != 4) { throw new IllegalArgumentException("input height array has to have 4 elements"); } GeoPoint[] corners = new GeoPoint[2]; double[] phiAndLambda;... | GeoUtils { public static GeoPoint[] computeCorners(final SLCImage meta, final Orbit orbit, final Window tile, final float height[]) throws Exception { if (height.length != 4) { throw new IllegalArgumentException("input height array has to have 4 elements"); } GeoPoint[] corners = new GeoPoint[2]; double[] phiAndLambda;... | GeoUtils { public static GeoPoint[] computeCorners(final SLCImage meta, final Orbit orbit, final Window tile, final float height[]) throws Exception { if (height.length != 4) { throw new IllegalArgumentException("input height array has to have 4 elements"); } GeoPoint[] corners = new GeoPoint[2]; double[] phiAndLambda;... |
@Test(expected = IllegalArgumentException.class) public void test_whenStartIsAllDayAndDueIsNot_throwsIllegalArgument() { new TimeData<>(DateTime.now().toAllDay(), DateTime.now()) .updatedBuilder(mock(TransactionContext.class), mock(ContentProviderOperation.Builder.class)); } | @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'start' and 'due' must have the same ... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... |
@Test public void testAbsentWithStartAndDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData,... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test public void testPresent() { ContentValues instanceData = new Overridden(new Present<>(new DateTime(40)), ContentValues::new).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, 40)); assertThat(instanceData.size(), is(1)); } | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test public void testPresentWithStartAndDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(new Present<>(new DateTime(40)), () -> new ContentValues(values)).value(); ... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test public void testNoValue() { assertThat(new Enduring(ContentValues::new), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(ContentValues::new).value().size(), is(1)); } | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, ... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... |
@Test public void testStartValue() { ContentValues values = new ContentValues(1); values.put(TaskContract.Instances.INSTANCE_START, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Endurin... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, ... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... |
@Test public void testDueValue() { ContentValues values = new ContentValues(1); values.put(TaskContract.Instances.INSTANCE_DUE, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DURATION, nullValue(Long.class)))); assertThat(new Enduring(()... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, ... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... |
@Test public void testStartDueValue() { ContentValues values = new ContentValues(2); values.put(TaskContract.Instances.INSTANCE_START, 1); values.put(TaskContract.Instances.INSTANCE_DUE, 10); assertThat(new Enduring(() -> new ContentValues(values)), hasValue(new ContentValuesWithLong(TaskContract.Instances.INSTANCE_DUR... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_DUE)), (start, ... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... | Enduring implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_DURATION, new Backed<Long>( new Zipped<>( new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new NullSafe<>(values.getAsLong(Tas... |
@Test public void testFieldName() { assertThat(new DateTimeIterableFieldAdapter<>("x", "y").fieldName(), is("x")); } | @Override String fieldName() { return mDateTimeListFieldName; } | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override String fieldName() { return mDateTimeListFieldName; } } | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override String fieldName() { return mDateTimeListFieldName; } DateTimeIterableFieldAdapter(String datetimeListFieldName, String timezoneFieldName); } | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override String fieldName() { return mDateTimeListFieldName; } DateTimeIterableFieldAdapter(String datetimeListFieldName, String timezoneFieldName); @Override Iterable<DateTime> getFrom(ContentValues values); @Override Iterable<D... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override String fieldName() { return mDateTimeListFieldName; } DateTimeIterableFieldAdapter(String datetimeListFieldName, String timezoneFieldName); @Override Iterable<DateTime> getFrom(ContentValues values); @Override Iterable<D... |
@Test public void testGetFromCVAllDay1() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109"); assertThat(adapter.getFrom(values), iteratesTo(DateTime.parse("20180109"))); } | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test public void testGetFromCVAllDay2() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109,20180110"); assertThat(adapter.getFrom(values), iteratesTo(DateTime.parse("20180109"), DateTime.parse("2... | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test(expected = IllegalArgumentException.class) public void test_whenDueIsAllDayAndStartIsNot_throwsIllegalArgument() { new TimeData<>(DateTime.now(), DateTime.now().toAllDay()) .updatedBuilder(mock(TransactionContext.class), mock(ContentProviderOperation.Builder.class)); } | @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'start' and 'due' must have the same ... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... | TimeData implements RowData<T> { @NonNull @Override public ContentProviderOperation.Builder updatedBuilder(@NonNull TransactionContext transactionContext, @NonNull ContentProviderOperation.Builder builder) { if (mDue.isPresent() && mStart.isAllDay() != mDue.value().isAllDay()) { throw new IllegalArgumentException("'sta... |
@Test public void testGetFromCVFloating1() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109T140000"); values.putNull("y"); assertThat(adapter.getFrom(values), iteratesTo(DateTime.parse("20180109... | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test public void testGetFromCVFloating2() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109T140000,20180110T140000"); values.putNull("y"); assertThat(adapter.getFrom(values), iteratesTo(DateTime... | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test public void testGetFromCVAbsolute1() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109T140000Z"); values.put("y", "Europe/Berlin"); assertThat(adapter.getFrom(values), iteratesTo(DateTime.p... | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test public void testGetFromCVAbsolute2() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); values.put("x", "20180109T140000Z,20180110T140000Z"); values.put("y", "Europe/Berlin"); assertThat(adapter.getFrom(values), iter... | @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZoneFieldName == null ? null : values.getAsString(mTimeZoneFieldName); TimeZone timeZone = tim... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public Iterable<DateTime> getFrom(ContentValues values) { String datetimeList = values.getAsString(mDateTimeListFieldName); if (datetimeList == null) { return EmptyIterable.instance(); } String timezoneString = mTimeZone... |
@Test public void testSetInNull() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, null); assertThat(values.getAsString("x"), nullValue()); } | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInEmpty() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, EmptyIterable.instance()); assertThat(values.getAsString("x"), nullValue()); } | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInSingleAllDay() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109"))); assertThat(values.getAsString("x"), is("20180109")); } | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInSingleFloating() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109T150000"))); assertThat(values.getAsString("x"), is("20180109T150000"))... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInSingleAbsolute() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("Europe/Berlin", "20180109T150000"))); assertThat(values.getAsString("x"), is("2... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInDoubleAllDay() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109"), DateTime.parse("20180110"))); assertThat(values.getAsString("x"), is(... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testValidFlags_dontThrowException() { new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(); new Toggled(Notification.DEFAULT_VIBRATE, true, new NoSignal()).value(); new Toggled(Notification.DEFAULT_LIGHTS, true, new NoSignal()).value(); } | @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.value(), mFlag) : removeFlag(mOriginal.va... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... |
@Test public void testSetInDoubleFloating() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109T150000"), DateTime.parse("20180110T150000"))); assertThat(values.getAs... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInDoubleAbsolute() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("Europe/Berlin", "20180109T150000"), DateTime.parse("Europe/Berlin", "20180110T1... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInMultiAllDay() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109"), DateTime.parse("20180110"), DateTime.parse("20180111"))); assertThat(v... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInMultiFloating() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("20180109T150000"), DateTime.parse("20180110T150000"), DateTime.parse("20180111T1... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void testSetInMultiAbsolute() { ContentValues values = new ContentValues(); FieldAdapter<Iterable<DateTime>, ?> adapter = new DateTimeIterableFieldAdapter<TaskAdapter>("x", "y"); adapter.setIn(values, new Seq<>(DateTime.parse("Europe/Berlin", "20180109T150000"), DateTime.parse("Europe/Berlin", "20180110T15... | @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.put(mDateTimeListFieldName, stringValue.isEmpty() ? null : stringValue); } else { values.p... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... | DateTimeIterableFieldAdapter extends SimpleFieldAdapter<Iterable<DateTime>, EntityType> { @Override public void setIn(ContentValues values, Iterable<DateTime> value) { if (value != null) { String stringValue = TextUtils.join(",", new Mapped<>(dt -> dt.isFloating() ? dt : dt.shiftTimeZone(DateTime.UTC), value)); values.... |
@Test public void test() { ContentValues values = new ContentValues(); values.put("a", 123); values.put("b", "stringValue"); values.put("c", new byte[] { 3, 2, 1 }); values.putNull("d"); MatrixCursor cursor = new MatrixCursor(new String[] { "c", "b", "a", "d", "f" }); cursor.addRow(new Seq<>(new byte[] { 3, 2, 1 }, "st... | @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals(mValues.getAsByteArray(key), testedInstance.g... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... |
@Test public void testMissingColumns() { ContentValues values = new ContentValues(); values.put("a", 123); values.put("b", "stringValue"); values.put("c", new byte[] { 3, 2, 1 }); values.putNull("d"); MatrixCursor cursor = new MatrixCursor(new String[] { "c", "b" }); cursor.addRow(new Seq<>(new byte[] { 3, 2, 1 }, "str... | @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals(mValues.getAsByteArray(key), testedInstance.g... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... | ContainsValues implements Predicate<Cursor> { @Override public boolean satisfiedBy(Cursor testedInstance) { for (String key : mValues.keySet()) { int columnIdx = testedInstance.getColumnIndex(key); if (columnIdx < 0) { return false; } if (testedInstance.getType(columnIdx) == Cursor.FIELD_TYPE_BLOB) { if (!Arrays.equals... |
@Test(expected = IllegalArgumentException.class) public void testInValidFlag_throwsException() { new Toggled(15, true, new NoSignal()).value(); } | @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.value(), mFlag) : removeFlag(mOriginal.va... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... |
@Test public void testAddingFlag() { assertThat(new Toggled(Notification.DEFAULT_SOUND, true, new NoSignal()).value(), is(new NoSignal().value() | Notification.DEFAULT_SOUND)); assertThat(new Toggled(Notification.DEFAULT_SOUND, false, new NoSignal()).value(), is(new NoSignal().value())); } | @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.value(), mFlag) : removeFlag(mOriginal.va... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... | Toggled implements NotificationSignal { @Override public int value() { if (mFlag != Notification.DEFAULT_VIBRATE && mFlag != Notification.DEFAULT_SOUND && mFlag != Notification.DEFAULT_LIGHTS) { throw new IllegalArgumentException("Notification signal flag is not valid: " + mFlag); } return mEnable ? addFlag(mOriginal.v... |
@Test public void testValue() { ContentValues values = new VanillaInstanceData().value(); assertThat(values.get(TaskContract.Instances.INSTANCE_START), nullValue()); assertThat(values.get(TaskContract.Instances.INSTANCE_START_SORTING), nullValue()); assertThat(values.get(TaskContract.Instances.INSTANCE_DUE), nullValue(... | @Override public ContentValues value() { ContentValues values = new ContentValues(6); values.putNull(TaskContract.Instances.INSTANCE_START); values.putNull(TaskContract.Instances.INSTANCE_START_SORTING); values.putNull(TaskContract.Instances.INSTANCE_DUE); values.putNull(TaskContract.Instances.INSTANCE_DUE_SORTING); va... | VanillaInstanceData implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = new ContentValues(6); values.putNull(TaskContract.Instances.INSTANCE_START); values.putNull(TaskContract.Instances.INSTANCE_START_SORTING); values.putNull(TaskContract.Instances.INSTANCE_DUE); values.p... | VanillaInstanceData implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = new ContentValues(6); values.putNull(TaskContract.Instances.INSTANCE_START); values.putNull(TaskContract.Instances.INSTANCE_START_SORTING); values.putNull(TaskContract.Instances.INSTANCE_DUE); values.p... | VanillaInstanceData implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = new ContentValues(6); values.putNull(TaskContract.Instances.INSTANCE_START); values.putNull(TaskContract.Instances.INSTANCE_START_SORTING); values.putNull(TaskContract.Instances.INSTANCE_DUE); values.p... | VanillaInstanceData implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = new ContentValues(6); values.putNull(TaskContract.Instances.INSTANCE_START); values.putNull(TaskContract.Instances.INSTANCE_START_SORTING); values.putNull(TaskContract.Instances.INSTANCE_DUE); values.p... |
@Test public void testValue() { assertThat(new TaskRelated(123, ContentValues::new), hasValue(new ContentValuesWithLong(TaskContract.Instances.TASK_ID, 123))); } | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.TASK_ID, mTaskId); return values; } | TaskRelated implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.TASK_ID, mTaskId); return values; } } | TaskRelated implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.TASK_ID, mTaskId); return values; } TaskRelated(long taskId, Single<ContentValues> delegate); } | TaskRelated implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.TASK_ID, mTaskId); return values; } TaskRelated(long taskId, Single<ContentValues> delegate); @Override ContentValues value(); } | TaskRelated implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.TASK_ID, mTaskId); return values; } TaskRelated(long taskId, Single<ContentValues> delegate); @Override ContentValues value(); } |
@Test public void testAbsent() { ContentValues instanceData = new Overridden(absent(), ContentValues::new).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, nullValue(Long.class))); assertThat(instanceData.size(), is(1)); } | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test public void testAbsentWithStart() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_START, 10); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test public void testAbsentWithDue() { ContentValues values = new ContentValues(); values.put(TaskContract.Instances.INSTANCE_DUE, 20); ContentValues instanceData = new Overridden(absent(), () -> new ContentValues(values)).value(); assertThat(instanceData, new ContentValuesWithLong(TaskContract.Instances.INSTANCE_ORIG... | @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong(TaskContract.Instances.INSTANCE_START)), new ... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... | Overridden implements Single<ContentValues> { @Override public ContentValues value() { ContentValues values = mDelegate.value(); values.put(TaskContract.Instances.INSTANCE_ORIGINAL_TIME, new Backed<Long>( new FirstPresent<>( new Seq<>( new Mapped<>(DateTime::getTimestamp, mOriginalTime), new NullSafe<>(values.getAsLong... |
@Test void isEmptyWithNoData() { MavenScm mavenScm = new MavenScm.Builder().build(); assertThat(mavenScm.isEmpty()).isTrue(); } | public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); boolean isEmpty(); String getConnection(); String getDeveloperConnection(); String getTag(); String getUrl(); } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); boolean isEmpty(); String getConnection(); String getDeveloperConnection(); String getTag(); String getUrl(); } |
@Test void isEmptyWithData() { MavenScm mavenScm = new MavenScm.Builder().connection("some-connection").build(); assertThat(mavenScm.isEmpty()).isFalse(); } | public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); boolean isEmpty(); String getConnection(); String getDeveloperConnection(); String getTag(); String getUrl(); } | MavenScm { public boolean isEmpty() { return this.connection == null && this.developerConnection == null && this.tag == null && this.url == null; } MavenScm(Builder builder); boolean isEmpty(); String getConnection(); String getDeveloperConnection(); String getTag(); String getUrl(); } |
@Test public void testMyFirstActor_Greeting() { final TestKit probe = new TestKit(actorSystem); final ActorRef myFirstActor = actorSystem.actorOf(MyFirstActor.props()); myFirstActor.tell(new Greeting(HELLO_WORLD), probe.getRef()); final Greeting greeting = probe.expectMsgClass(Greeting.class); assertEquals(HELLO_WORLD,... | static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } | MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } } | MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } } | MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } static Props props(); @Override Receive createReceive(); } | MyFirstActor extends AbstractActor { static public Props props() { return Props.create(MyFirstActor.class, () -> new MyFirstActor()); } static Props props(); @Override Receive createReceive(); } |
@Test public void testAdd() { assertEquals("3", mCalculator.evaluate(Matchers.anyString())); final String result = mCalculator.add(1,2); assertEquals("3", result); when(mCalculator.evaluate(Matchers.anyString())).thenReturn("5"); assertEquals("5", mCalculator.evaluate(Matchers.anyString())); } | @Override public String add(int... values) { int sum = 0; for (int value : values) { sum += value; } return format(sum); } | Calculator implements ICalculator { @Override public String add(int... values) { int sum = 0; for (int value : values) { sum += value; } return format(sum); } } | Calculator implements ICalculator { @Override public String add(int... values) { int sum = 0; for (int value : values) { sum += value; } return format(sum); } } | Calculator implements ICalculator { @Override public String add(int... values) { int sum = 0; for (int value : values) { sum += value; } return format(sum); } @Override String add(int... values); @Override String multiply(int... values); @Override String evaluate(String value); } | Calculator implements ICalculator { @Override public String add(int... values) { int sum = 0; for (int value : values) { sum += value; } return format(sum); } @Override String add(int... values); @Override String multiply(int... values); @Override String evaluate(String value); } |
@Test public void calculateSum() throws Exception { assertEquals(BASE_PATH + "/" + "calc?input=1%2B15", mCalcApi.getEvaluateSumUrl(1, 15)); } | public String getEvaluateSumUrl(final int a, final int b) { return getEvaluateUrl(a + "+" + b); } | CalcApi { public String getEvaluateSumUrl(final int a, final int b) { return getEvaluateUrl(a + "+" + b); } } | CalcApi { public String getEvaluateSumUrl(final int a, final int b) { return getEvaluateUrl(a + "+" + b); } CalcApi(final String pBasePath); } | CalcApi { public String getEvaluateSumUrl(final int a, final int b) { return getEvaluateUrl(a + "+" + b); } CalcApi(final String pBasePath); String getEvaluateSumUrl(final int a, final int b); String getEvaluateUrl(String input); } | CalcApi { public String getEvaluateSumUrl(final int a, final int b) { return getEvaluateUrl(a + "+" + b); } CalcApi(final String pBasePath); String getEvaluateSumUrl(final int a, final int b); String getEvaluateUrl(String input); } |
@Test public void evaluate() throws Exception { assertEquals(BASE_PATH + "/" + "calc?input=I%27m+lucky", mCalcApi.getEvaluateUrl("I'm lucky")); } | public String getEvaluateUrl(String input) { try { return mBasePath + CALC + URLEncoder.encode(input, "UTF-8"); } catch (final UnsupportedEncodingException pE) { throw new IllegalStateException(pE); } } | CalcApi { public String getEvaluateUrl(String input) { try { return mBasePath + CALC + URLEncoder.encode(input, "UTF-8"); } catch (final UnsupportedEncodingException pE) { throw new IllegalStateException(pE); } } } | CalcApi { public String getEvaluateUrl(String input) { try { return mBasePath + CALC + URLEncoder.encode(input, "UTF-8"); } catch (final UnsupportedEncodingException pE) { throw new IllegalStateException(pE); } } CalcApi(final String pBasePath); } | CalcApi { public String getEvaluateUrl(String input) { try { return mBasePath + CALC + URLEncoder.encode(input, "UTF-8"); } catch (final UnsupportedEncodingException pE) { throw new IllegalStateException(pE); } } CalcApi(final String pBasePath); String getEvaluateSumUrl(final int a, final int b); String getEvaluateUrl(... | CalcApi { public String getEvaluateUrl(String input) { try { return mBasePath + CALC + URLEncoder.encode(input, "UTF-8"); } catch (final UnsupportedEncodingException pE) { throw new IllegalStateException(pE); } } CalcApi(final String pBasePath); String getEvaluateSumUrl(final int a, final int b); String getEvaluateUrl(... |
@Test public void shouldExcludeByGroupAndArtifactId() throws ArtifactFilterException { assertThat(filter.isArtifactIncluded(excluded)).isFalse(); assertThat(filter.isArtifactIncluded(included1)).isTrue(); assertThat(filter.isArtifactIncluded(included2)).isTrue(); } | @Override public boolean isArtifactIncluded(final Artifact artifact) throws ArtifactFilterException { return !(artifact.getGroupId().equals(excludedGroupId) && artifact.getArtifactId().equals(excludedArtifactId)); } | ExcludeFilter implements ArtifactsFilter { @Override public boolean isArtifactIncluded(final Artifact artifact) throws ArtifactFilterException { return !(artifact.getGroupId().equals(excludedGroupId) && artifact.getArtifactId().equals(excludedArtifactId)); } } | ExcludeFilter implements ArtifactsFilter { @Override public boolean isArtifactIncluded(final Artifact artifact) throws ArtifactFilterException { return !(artifact.getGroupId().equals(excludedGroupId) && artifact.getArtifactId().equals(excludedArtifactId)); } ExcludeFilter(final String excludedGroupId, final String excl... | ExcludeFilter implements ArtifactsFilter { @Override public boolean isArtifactIncluded(final Artifact artifact) throws ArtifactFilterException { return !(artifact.getGroupId().equals(excludedGroupId) && artifact.getArtifactId().equals(excludedArtifactId)); } ExcludeFilter(final String excludedGroupId, final String excl... | ExcludeFilter implements ArtifactsFilter { @Override public boolean isArtifactIncluded(final Artifact artifact) throws ArtifactFilterException { return !(artifact.getGroupId().equals(excludedGroupId) && artifact.getArtifactId().equals(excludedArtifactId)); } ExcludeFilter(final String excludedGroupId, final String excl... |
@Test public void shouldThrowExceptionOnMissingProperties() { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final Map<String, Object> options = new HashMap<>(); assertThrows(IllegalStateException.class, () -> customizer.customize(NOT_USED, options)); } | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(ComponentProperties.SPECIFICATION)) { consumeOption(options, ComponentP... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { if (options.containsKey(ComponentProperties.WSDL_URL)) { options.remove(ComponentProperties.SPECIFICATION); } else if (options.containsKey(C... |
@Test public void shouldAddEndpointName() { final EndpointCustomizer customizer = new EndpointCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put(ComponentProperties.SERVICE_NAME, "{namespace}service1"); options.put(ComponentProperties.PORT_NAME, "port1"); customizer.customize(NOT_USED, optio... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, SERVICE_NAME, serviceObject -> { final String serviceName = (String) serviceObject; final QName service = QName.valueOf(serviceName); options.put(SERVICE_NAME, serviceName); consumeOption... | EndpointCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, SERVICE_NAME, serviceObject -> { final String serviceName = (String) serviceObject; final QName service = QName.valueOf(serviceNam... | EndpointCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, SERVICE_NAME, serviceObject -> { final String serviceName = (String) serviceObject; final QName service = QName.valueOf(serviceNam... | EndpointCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, SERVICE_NAME, serviceObject -> { final String serviceName = (String) serviceObject; final QName service = QName.valueOf(serviceNam... | EndpointCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, SERVICE_NAME, serviceObject -> { final String serviceName = (String) serviceObject; final QName service = QName.valueOf(serviceNam... |
@Test public void verifyParameters() { Result result = verifier.verifyParameters(parameters); assertEquals(errorDescriptions(result), Result.Status.OK, result.getStatus()); } | @Override protected Result verifyParameters(Map<String, Object> parameters) { ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS) .error(ResultErrorHelper.requiresOption("userName", parameters)) .error(ResultErrorHelper.requiresOption("userPassword", parameters)) .error(ResultEr... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyParameters(Map<String, Object> parameters) { ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS) .error(ResultErrorHelper.requiresOption("userName", parameters)) .error(ResultErrorH... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyParameters(Map<String, Object> parameters) { ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS) .error(ResultErrorHelper.requiresOption("userName", parameters)) .error(ResultErrorH... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyParameters(Map<String, Object> parameters) { ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS) .error(ResultErrorHelper.requiresOption("userName", parameters)) .error(ResultErrorH... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyParameters(Map<String, Object> parameters) { ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS) .error(ResultErrorHelper.requiresOption("userName", parameters)) .error(ResultErrorH... |
@Test public void verifyConnectivity() { Result result = verifier.verifyConnectivity(parameters); assertEquals(errorDescriptions(result), Result.Status.OK, result.getStatus()); } | @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY) .error(parameters, this::verifyCredentials).build(); } | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY) .error(parameters, this::verifyCredentials).build(); } } | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY) .error(parameters, this::verifyCredentials).build(); } protected BoxVerifierExtension(String def... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY) .error(parameters, this::verifyCredentials).build(); } protected BoxVerifierExtension(String def... | BoxVerifierExtension extends DefaultComponentVerifierExtension { @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY) .error(parameters, this::verifyCredentials).build(); } protected BoxVerifierExtension(String def... |
@Test public void testAfterProducer() throws Exception { String id = "12345"; String content = "Test content: åäö"; String encoding = StandardCharsets.ISO_8859_1.name(); int size = content.getBytes(encoding).length; Map<String, Object> options = new HashMap<>(); options.put("fileId", id); options.put("encoding", encodi... | private void afterProducer(Exchange exchange) { BoxFile file = new BoxFile(); Message in = exchange.getIn(); file.setId(fileId); ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class); try { file.setContent(new String(output.toByteArray(), encoding)); } catch (UnsupportedEncodingException e) { LOG.error... | BoxDownloadCustomizer implements ComponentProxyCustomizer { private void afterProducer(Exchange exchange) { BoxFile file = new BoxFile(); Message in = exchange.getIn(); file.setId(fileId); ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class); try { file.setContent(new String(output.toByteArray(), enco... | BoxDownloadCustomizer implements ComponentProxyCustomizer { private void afterProducer(Exchange exchange) { BoxFile file = new BoxFile(); Message in = exchange.getIn(); file.setId(fileId); ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class); try { file.setContent(new String(output.toByteArray(), enco... | BoxDownloadCustomizer implements ComponentProxyCustomizer { private void afterProducer(Exchange exchange) { BoxFile file = new BoxFile(); Message in = exchange.getIn(); file.setId(fileId); ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class); try { file.setContent(new String(output.toByteArray(), enco... | BoxDownloadCustomizer implements ComponentProxyCustomizer { private void afterProducer(Exchange exchange) { BoxFile file = new BoxFile(); Message in = exchange.getIn(); file.setId(fileId); ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class); try { file.setContent(new String(output.toByteArray(), enco... |
@Test public void retrieveTableListTes() { CamelContext context = new DefaultCamelContext(); ServiceNowMetaDataExtension extension = new ServiceNowMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("instanceName", System.getProperty("servicenow.instance")); properties.put("user... | @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE); final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition"); if (ObjectHelper.equalIgnoreCase(objectType, ServiceNowConstants.RESO... | ServiceNowMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE); final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition"); if (O... | ServiceNowMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE); final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition"); if (O... | ServiceNowMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE); final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition"); if (O... | ServiceNowMetaDataExtension extends AbstractMetaDataExtension { @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String objectType = ConnectorOptions.extractOption(parameters, OBJECT_TYPE); final String metaType = ConnectorOptions.extractOption(parameters, META_TYPE, "definition"); if (O... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); options.put("title", "SyndesisTest"); options.put("timeZone", "America/New_York"); options.put("locale", "en"); customizer.customize(getComponent(), optio... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::afterProducer); } | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... |
@Test public void testBeforeProducerFromModel() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleSpreadsheet model = new GoogleSpreadsheet(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisTest"); model.set... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::afterProducer); } | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsUpdateSpreadsheetCustomizer::af... |
@Test public void testAfterProducer() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); BatchUpdateSpreadsheetResponse batchUpdateResponse = new BatchUpdateSpreadsheetResponse(); batchUpdateResponse.setSpreadsheetId(getSpreadsheetId()... | private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final BatchUpdateSpreadsheetResponse batchUpdateResponse = in.getBody(BatchUpdateSpreadsheetResponse.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); model.setSpreadsheetId(batchUpdateResponse.getSpreadsheetId()); if (... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final BatchUpdateSpreadsheetResponse batchUpdateResponse = in.getBody(BatchUpdateSpreadsheetResponse.class); GoogleSpreadsheet model = new GoogleSprea... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final BatchUpdateSpreadsheetResponse batchUpdateResponse = in.getBody(BatchUpdateSpreadsheetResponse.class); GoogleSpreadsheet model = new GoogleSprea... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final BatchUpdateSpreadsheetResponse batchUpdateResponse = in.getBody(BatchUpdateSpreadsheetResponse.class); GoogleSpreadsheet model = new GoogleSprea... | GoogleSheetsUpdateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final BatchUpdateSpreadsheetResponse batchUpdateResponse = in.getBody(BatchUpdateSpreadsheetResponse.class); GoogleSpreadsheet model = new GoogleSprea... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); getComponent().getBeforeProducer().process(in... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void shouldFilterByDefaultForJavaBeanInput() { final JsonSimplePredicate predicate = new JsonSimplePredicate("${body.prop} == 1", CONTEXT); assertThat(predicate.matches(exchangeWith(new Bean()))).isEqualTo(true); } | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void testBeforeProducerFromModel() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setSpreadsheetId(getSpreadsheetId()); model.setSourceSheetId(0); model.setSheetId... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testDivergingSourceAndTargetSheets() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setSpreadsheetId(getSpreadsheetId()); model.setSourceSheetId(0); model.set... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testDivergingSourceAndTargetSheetsWithExplicitStart() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setStart("E10"); model.setSpreadsheetId(getSpreadsheetId(... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testExplicitPivotTableStart() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setStart("C12"); model.setSpreadsheetId(getSpreadsheetId()); model.setSourceRange... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testCustomValueGroupFunction() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setStart("C12"); model.setSpreadsheetId(getSpreadsheetId()); model.setSourceRang... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testCustomValueGroupFormula() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GooglePivotTable model = new GooglePivotTable(); model.setSpreadsheetId(getSpreadsheetId()); model.setSourceRange("A1:D10"); GooglePivot... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... | GoogleSheetsAddPivotTableCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String,... |
@Test public void testFromCellId() { CellCoordinate coordinate = CellCoordinate.fromCellId(cellId); Assert.assertEquals(rowIndexCheck, coordinate.getRowIndex()); Assert.assertEquals(columnIndexCheck, coordinate.getColumnIndex()); } | public static CellCoordinate fromCellId(String cellId) { CellCoordinate coordinate = new CellCoordinate(); if (cellId != null) { coordinate.setRowIndex(getRowIndex(cellId)); coordinate.setColumnIndex(getColumnIndex(cellId)); } return coordinate; } | CellCoordinate { public static CellCoordinate fromCellId(String cellId) { CellCoordinate coordinate = new CellCoordinate(); if (cellId != null) { coordinate.setRowIndex(getRowIndex(cellId)); coordinate.setColumnIndex(getColumnIndex(cellId)); } return coordinate; } } | CellCoordinate { public static CellCoordinate fromCellId(String cellId) { CellCoordinate coordinate = new CellCoordinate(); if (cellId != null) { coordinate.setRowIndex(getRowIndex(cellId)); coordinate.setColumnIndex(getColumnIndex(cellId)); } return coordinate; } CellCoordinate(); } | CellCoordinate { public static CellCoordinate fromCellId(String cellId) { CellCoordinate coordinate = new CellCoordinate(); if (cellId != null) { coordinate.setRowIndex(getRowIndex(cellId)); coordinate.setColumnIndex(getColumnIndex(cellId)); } return coordinate; } CellCoordinate(); static CellCoordinate fromCellId(Stri... | CellCoordinate { public static CellCoordinate fromCellId(String cellId) { CellCoordinate coordinate = new CellCoordinate(); if (cellId != null) { coordinate.setRowIndex(getRowIndex(cellId)); coordinate.setColumnIndex(getColumnIndex(cellId)); } return coordinate; } CellCoordinate(); static CellCoordinate fromCellId(Stri... |
@Test public void testGetColumnName() { Assert.assertEquals(columnName, CellCoordinate.getColumnName(columnIndexCheck)); String[] names = new String[columnIndexCheck]; Arrays.fill(names, "Foo"); Assert.assertEquals(columnName, CellCoordinate.getColumnName(columnIndexCheck, 0, names)); names = new String[columnIndexChec... | public static String getColumnName(int columnIndex) { String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder columnName = new StringBuilder(); int index = columnIndex; int overflowIndex = -1; while (index > 25) { overflowIndex++; index -= 26; } if (overflowIndex >= 0) { columnName.append(alphabet.toCharArray()[o... | CellCoordinate { public static String getColumnName(int columnIndex) { String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder columnName = new StringBuilder(); int index = columnIndex; int overflowIndex = -1; while (index > 25) { overflowIndex++; index -= 26; } if (overflowIndex >= 0) { columnName.append(alphabe... | CellCoordinate { public static String getColumnName(int columnIndex) { String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder columnName = new StringBuilder(); int index = columnIndex; int overflowIndex = -1; while (index > 25) { overflowIndex++; index -= 26; } if (overflowIndex >= 0) { columnName.append(alphabe... | CellCoordinate { public static String getColumnName(int columnIndex) { String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder columnName = new StringBuilder(); int index = columnIndex; int overflowIndex = -1; while (index > 25) { overflowIndex++; index -= 26; } if (overflowIndex >= 0) { columnName.append(alphabe... | CellCoordinate { public static String getColumnName(int columnIndex) { String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder columnName = new StringBuilder(); int index = columnIndex; int overflowIndex = -1; while (index > 25) { overflowIndex++; index -= 26; } if (overflowIndex >= 0) { columnName.append(alphabe... |
@Test public void testFromRange() { RangeCoordinate coordinate = RangeCoordinate.fromRange(range); Assert.assertEquals(rowStartIndex, coordinate.getRowStartIndex()); Assert.assertEquals(rowEndIndex, coordinate.getRowEndIndex()); Assert.assertEquals(columnStartIndex, coordinate.getColumnStartIndex()); Assert.assertEqual... | public static RangeCoordinate fromRange(String range) { RangeCoordinate coordinate = new RangeCoordinate(); String rangeExpression = normalizeRange(range); if (rangeExpression.contains(":")) { String[] coordinates = rangeExpression.split(":", -1); coordinate.setRowStartIndex(getRowIndex(coordinates[0])); coordinate.set... | RangeCoordinate extends CellCoordinate { public static RangeCoordinate fromRange(String range) { RangeCoordinate coordinate = new RangeCoordinate(); String rangeExpression = normalizeRange(range); if (rangeExpression.contains(":")) { String[] coordinates = rangeExpression.split(":", -1); coordinate.setRowStartIndex(get... | RangeCoordinate extends CellCoordinate { public static RangeCoordinate fromRange(String range) { RangeCoordinate coordinate = new RangeCoordinate(); String rangeExpression = normalizeRange(range); if (rangeExpression.contains(":")) { String[] coordinates = rangeExpression.split(":", -1); coordinate.setRowStartIndex(get... | RangeCoordinate extends CellCoordinate { public static RangeCoordinate fromRange(String range) { RangeCoordinate coordinate = new RangeCoordinate(); String rangeExpression = normalizeRange(range); if (rangeExpression.contains(":")) { String[] coordinates = rangeExpression.split(":", -1); coordinate.setRowStartIndex(get... | RangeCoordinate extends CellCoordinate { public static RangeCoordinate fromRange(String range) { RangeCoordinate coordinate = new RangeCoordinate(); String rangeExpression = normalizeRange(range); if (rangeExpression.contains(":")) { String[] coordinates = rangeExpression.split(":", -1); coordinate.setRowStartIndex(get... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("title", "SyndesisTest"); options.put("timeZone", "America/New_York"); options.put("locale", "en"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(create... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::afterProducer); } | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... |
@Test public void shouldFilterByDefaultForNonJsonInput() { final JsonSimplePredicate predicate = new JsonSimplePredicate("${body} == 1", CONTEXT); assertThat(predicate.matches(exchangeWith("1"))).isEqualTo(true); assertThat(predicate.matches(exchangeWith("wat"))).isEqualTo(false); } | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void testBeforeProducerFromModel() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleSpreadsheet model = new GoogleSpreadsheet(); model.setTitle("SyndesisTest"); model.setTimeZone("America/New_York"); model.setLocal... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::afterProducer); } | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(GoogleSheetsCreateSpreadsheetCustomizer::af... |
@Test public void testAfterProducer() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); Spreadsheet spreadsheet = new Spreadsheet(); spreadsheet.setSpreadsheetId(getSpreadsheetId()); SpreadsheetProperties spreadsheetProperties = new S... | private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = in.getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsheet)) { model.setSpreadsheetId(spreadsheet.getSpreadsheetId()); SpreadsheetPro... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = in.getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsh... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = in.getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsh... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = in.getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsh... | GoogleSheetsCreateSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void afterProducer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = in.getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsh... |
@Test public void testBeforeConsumer() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); options.put("range", range); options.put("splitResults", false); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelCon... | private void beforeConsumer(Exchange exchange) throws JsonProcessingException { final Message in = exchange.getIn(); if (splitResults) { in.setBody(createModelFromSplitValues(in)); } else { in.setBody(createModelFromValueRange(in)); } } | GoogleSheetsGetValuesCustomizer implements ComponentProxyCustomizer { private void beforeConsumer(Exchange exchange) throws JsonProcessingException { final Message in = exchange.getIn(); if (splitResults) { in.setBody(createModelFromSplitValues(in)); } else { in.setBody(createModelFromValueRange(in)); } } } | GoogleSheetsGetValuesCustomizer implements ComponentProxyCustomizer { private void beforeConsumer(Exchange exchange) throws JsonProcessingException { final Message in = exchange.getIn(); if (splitResults) { in.setBody(createModelFromSplitValues(in)); } else { in.setBody(createModelFromValueRange(in)); } } } | GoogleSheetsGetValuesCustomizer implements ComponentProxyCustomizer { private void beforeConsumer(Exchange exchange) throws JsonProcessingException { final Message in = exchange.getIn(); if (splitResults) { in.setBody(createModelFromSplitValues(in)); } else { in.setBody(createModelFromValueRange(in)); } } @Override vo... | GoogleSheetsGetValuesCustomizer implements ComponentProxyCustomizer { private void beforeConsumer(Exchange exchange) throws JsonProcessingException { final Message in = exchange.getIn(); if (splitResults) { in.setBody(createModelFromSplitValues(in)); } else { in.setBody(createModelFromValueRange(in)); } } @Override vo... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); options.put("title", "SyndesisChart"); options.put("subtitle", "Some subtitle"); customizer.customize(getComponent(), options); Exchange inbound = new Def... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... |
@Test public void testBeforeProducerFromModel() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleChart model = new GoogleChart(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisChart"); model.setSubtitle("S... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... |
@Test public void testBarChartWithMultipleSeries() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleChart model = new GoogleChart(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisBars"); model.setSheetId(0... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... |
@Test public void testPieChart() throws Exception { customizer.customize(getComponent(), new HashMap<>()); Exchange inbound = new DefaultExchange(createCamelContext()); GoogleChart model = new GoogleChart(); model.setSpreadsheetId(getSpreadsheetId()); model.setTitle("SyndesisPie"); model.setSheetId(0); GoogleChart.PieC... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... | GoogleSheetsAddChartCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, Obje... |
@Test public void testBeforeConsumer() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); Spreadsheet spreadsheet = new Spreadsheet(); spreadsheet... | private static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = exchange.getIn().getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEmpty(spreadsheet)) { model.setSpreadsheetId(spreadsheet.getSpreadsheetId());... | GoogleSheetsGetSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = exchange.getIn().getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEm... | GoogleSheetsGetSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = exchange.getIn().getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEm... | GoogleSheetsGetSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = exchange.getIn().getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEm... | GoogleSheetsGetSpreadsheetCustomizer implements ComponentProxyCustomizer { private static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Spreadsheet spreadsheet = exchange.getIn().getBody(Spreadsheet.class); GoogleSpreadsheet model = new GoogleSpreadsheet(); if (ObjectHelper.isNotEm... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); options.put("range", "A1"); options.put("majorDimension", RangeCoordinate.DIMENSION_ROWS); customizer.customize(getComponent(), options); Exchange inbound... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... |
@Test public void testAfterProducerRowDimension() throws Exception { String range = "A1:A5"; String sheetName = "Sheet1"; String majorDimension = RangeCoordinate.DIMENSION_ROWS; List<List<Object>> values = Arrays.asList(Collections.singletonList("a1"), Collections.singletonList("a2"), Collections.singletonList("a3"), C... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... |
@Test @Parameters({"{}, false", "{\"prop\": 1}, true", "{\"prop\": 2}, false"}) public void shouldFilterInputStreams(final String payload, final boolean expected) throws IOException { SingleReadInputStream inputStream = new SingleReadInputStream(payload); Exchange exchange = exchangeWith(inputStream); final JsonSimpleP... | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void testAfterProducerColumnDimension() throws Exception { String range = "A1:A5"; String sheetName = "Sheet1"; String majorDimension = RangeCoordinate.DIMENSION_COLUMNS; List<List<Object>> values = Collections.singletonList(Arrays.asList("a1", "a2", "a3", "a4", "a5")); List<String> expectedValueModel = Co... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } } | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... | GoogleSheetsRetrieveValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); component.setAfterProducer(this::afterProducer); } @Override void custom... |
@Test public void testBeforeProducerFromOptions() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("spreadsheetId", getSpreadsheetId()); options.put("range", "A1"); options.put("valueInputOption", "RAW"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerRowDimension() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:B1"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); String model = "{" + "\"spreadsheetId\": \"" + getSpreadsheetId... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerColumnDimension() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:A2"); options.put("majorDimension", RangeCoordinate.DIMENSION_COLUMNS); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContex... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerMultipleRows() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:B2"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); List<String> model = Arrays.asList("{" + "\"spreadsheetId\": \"... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerMultipleColumns() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:B2"); options.put("majorDimension", RangeCoordinate.DIMENSION_COLUMNS); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContex... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerAutoFillColumnValues() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:C2"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); List<String> model = Arrays.asList("{" + "\"spreadsheet... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerAutoFillRowValues() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:C3"); options.put("majorDimension", RangeCoordinate.DIMENSION_COLUMNS); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelCont... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerWithJsonArray() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:B2"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); String body = "[{" + "\"spreadsheetId\": \"" + getSpreadsheetI... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test public void testBeforeProducerWithJsonObject() throws Exception { Map<String, Object> options = new HashMap<>(); options.put("range", "A1:B2"); customizer.customize(getComponent(), options); Exchange inbound = new DefaultExchange(createCamelContext()); String body = "{\"spreadsheetId\": \"" + getSpreadsheetId() +... | @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } } | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... | GoogleSheetsUpdateValuesCustomizer implements ComponentProxyCustomizer { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { setApiMethod(options); component.setBeforeProducer(this::beforeProducer); } @Override void customize(ComponentProxyComponent component, Map<String, ... |
@Test @Parameters({"{}, false", "{\"prop\": 1}, true", "{\"prop\": 2}, false"}) public void shouldFilterOnJsonStrings(final String payload, final boolean expected) { final JsonSimplePredicate predicate = new JsonSimplePredicate("${body.prop} == 1", CONTEXT); assertThat(predicate.matches(exchangeWith(payload))).isEqualT... | @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true); final Message payload = exchangeForProce... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... | JsonSimplePredicate implements Predicate { @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) public boolean matches(final Exchange exchange) { final Exchange exchangeForProcessing = ExchangeHelper.createCopy(exchange, true... |
@Test public void shouldStoreSpecificationInTemporaryDirectory() { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final Map<String, Object> options = new HashMap<>(); options.put("specification", "the specification is here"); customizer.customize(NOT_USED, options); assertThat... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(options, "authenticationType"); final String specification = updateSecurit... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... |
@Test public void shouldRemoveUnwantedSecurity() throws IOException { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final String spec = RestSwaggerConnectorIntegrationTest.readSpecification("apikey.json"); final String specUpdated = RestSwaggerConnectorIntegrationTest.readSpe... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(options, "authenticationType"); final String specification = updateSecurit... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... |
@Test public void shouldNotUpdateSpecificationOnMissingSecurityDefinitionName() throws IOException { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final String spec = RestSwaggerConnectorIntegrationTest.readSpecification("apikey.json"); final Map<String, Object> options = new... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(options, "authenticationType"); final String specification = updateSecurit... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... |
@Test public void shouldNotUpdateSpecificationOnNullSecurityDefinitionName() throws IOException { final SpecificationResourceCustomizer customizer = new SpecificationResourceCustomizer(); final String spec = RestSwaggerConnectorIntegrationTest.readSpecification("apikey.json"); final Map<String, Object> options = new Ha... | @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(options, "authenticationType"); final String specification = updateSecurit... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... | SpecificationResourceCustomizer implements ComponentProxyCustomizer { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { consumeOption(options, "specification", specificationObject -> { try { final String authenticationType = ConnectorOptions.extractOption(opti... |
@Test public void testSwaggerProxyComponent() throws Exception { CamelContext context = new DefaultCamelContext(); ComponentProxyFactory factory = new ConnectorFactory(); ComponentProxyComponent proxy = factory.newInstance("swagger-1", "rest-openapi"); try { proxy.setCamelContext(context); proxy.start(); Endpoint endpo... | public SwaggerProxyComponent(final String componentId, final String componentScheme) { super(componentId, componentScheme); } | SwaggerProxyComponent extends ComponentProxyComponent { public SwaggerProxyComponent(final String componentId, final String componentScheme) { super(componentId, componentScheme); } } | SwaggerProxyComponent extends ComponentProxyComponent { public SwaggerProxyComponent(final String componentId, final String componentScheme) { super(componentId, componentScheme); } SwaggerProxyComponent(final String componentId, final String componentScheme); } | SwaggerProxyComponent extends ComponentProxyComponent { public SwaggerProxyComponent(final String componentId, final String componentScheme) { super(componentId, componentScheme); } SwaggerProxyComponent(final String componentId, final String componentScheme); @Override Endpoint createEndpoint(final String uri); void o... | SwaggerProxyComponent extends ComponentProxyComponent { public SwaggerProxyComponent(final String componentId, final String componentScheme) { super(componentId, componentScheme); } SwaggerProxyComponent(final String componentId, final String componentScheme); @Override Endpoint createEndpoint(final String uri); void o... |
@Test public void shouldDetermineAddingResponseConverterRobustly() { assertThat(ResponseCustomizer.isUnifiedDataShape(null)).isFalse(); assertThat(ResponseCustomizer.isUnifiedDataShape(new DataShape.Builder().build())).isFalse(); assertThat(ResponseCustomizer.isUnifiedDataShape(new DataShape.Builder().kind(DataShapeKin... | static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(specification)) { return false; } final JsonNode jsonSchema; try { jsonSchema =... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... |
@Test public void shouldDetermineAddingResponseConverterWithWrappedSchema() { assertThat(ResponseCustomizer .isUnifiedDataShape(new DataShape.Builder().kind(DataShapeKinds.JSON_SCHEMA).specification("{\"$id\":\"io:syndesis:wrapped\"}").build())).isTrue(); } | static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(specification)) { return false; } final JsonNode jsonSchema; try { jsonSchema =... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... | ResponseCustomizer implements ComponentProxyCustomizer, OutputDataShapeAware { static boolean isUnifiedDataShape(final DataShape dataShape) { if (dataShape == null || dataShape.getKind() != DataShapeKinds.JSON_SCHEMA) { return false; } final String specification = dataShape.getSpecification(); if (ObjectHelper.isEmpty(... |
@Test public void shouldSetHeaderAndWhitelist() throws Exception { final Exchange exchange = new DefaultExchange(new DefaultCamelContext()); new SetHttpHeader("name", "value").process(exchange); assertThat(exchange.getIn().getHeader("name")).isEqualTo("value"); assertThat(SyndesisHeaderStrategy.isWhitelisted(exchange, ... | @Override public void process(final Exchange exchange) throws Exception { super.process(exchange); SyndesisHeaderStrategy.whitelist(exchange, headerName); } | SetHttpHeader extends SetHeader { @Override public void process(final Exchange exchange) throws Exception { super.process(exchange); SyndesisHeaderStrategy.whitelist(exchange, headerName); } } | SetHttpHeader extends SetHeader { @Override public void process(final Exchange exchange) throws Exception { super.process(exchange); SyndesisHeaderStrategy.whitelist(exchange, headerName); } SetHttpHeader(final String headerName, final String headerValue); } | SetHttpHeader extends SetHeader { @Override public void process(final Exchange exchange) throws Exception { super.process(exchange); SyndesisHeaderStrategy.whitelist(exchange, headerName); } SetHttpHeader(final String headerName, final String headerValue); @Override void process(final Exchange exchange); } | SetHttpHeader extends SetHeader { @Override public void process(final Exchange exchange) throws Exception { super.process(exchange); SyndesisHeaderStrategy.whitelist(exchange, headerName); } SetHttpHeader(final String headerName, final String headerValue); @Override void process(final Exchange exchange); } |
@Test public void shouldNotThrowExceptionWhenRetryingInitially() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{}"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); } | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
@Test public void shouldNotThrowExceptionWhenRetryingWithDifferentRefreshToken() throws Exception { final OAuthRefreshTokenProcessor processor = createProcessor("{}"); processor.lastRefreshTokenTried.set("different-refresh-token"); assertThatThrownBy(() -> processor.process(exchange)).isSameAs(exception); } | @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException httpFailure = (HttpOperationFailedException) caught; LOG.warn("Failed i... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... | OAuthRefreshTokenOnFailProcessor extends OAuthRefreshTokenProcessor { @Override public void process(final Exchange exchange) throws Exception { final Exception caught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); if (caught instanceof HttpOperationFailedException) { final HttpOperationFailedException h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.