use of com.squareup.picasso.Request in project picasso by square.
the class PollexorRequestTransformerTest method nonHttpRequestsAreNotTransformed.
@Test
public void nonHttpRequestsAreNotTransformed() {
Request input = new Request.Builder(IMAGE_URI).build();
Request output = transformer.transformRequest(input);
assertThat(output).isSameAs(input);
}
use of com.squareup.picasso.Request in project picasso by square.
the class PollexorRequestTransformerTest method simpleResizeWithCenterInsideAndEncryption.
@Test
public void simpleResizeWithCenterInsideAndEncryption() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).centerInside().build();
Request output = secureTransformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
assertThat(output.centerInside).isFalse();
String expected = Thumbor.create(HOST, KEY).buildImage(IMAGE).resize(50, 50).fitIn().toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
use of com.squareup.picasso.Request in project picasso by square.
the class PollexorRequestTransformerTest method simpleResizeWithEncryption.
@Test
public void simpleResizeWithEncryption() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = secureTransformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST, KEY).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
use of com.squareup.picasso.Request in project picasso by square.
the class PollexorRequestTransformerTest method simpleResize.
@Test
public void simpleResize() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
use of com.squareup.picasso.Request in project picasso by square.
the class PollexorRequestTransformerTest method simpleResizeWithCenterCrop.
@Test
public void simpleResizeWithCenterCrop() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).centerCrop().build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
assertThat(output.centerCrop).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
Aggregations