// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption backgroundColorOf(int color) {
//   if (color < 0 || color > 0xFFFFFF) {
//     throw new IllegalArgumentException("Color must be in rgb hex range of 0x0 to 0xFFFFFF.");
//   }
//   return new ImageOption("bg", "rgb:" + format(Locale.getDefault(), "%06X", color));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption blackBackgroundColor() {
//   return backgroundColorOf(0);
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption fitOf(Resize resize) {
//   return new ImageOption("fit", resize.name());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption focusOn(Focus focus) {
//   return new ImageOption("f", focus.name());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption formatOf(Format format) {
//   return new ImageOption("fm", format.toUrlParameter());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption heightOf(int height) {
//   if (height <= 0) {
//     throw new IllegalArgumentException("Height has to be positive.");
//   }
//   return new ImageOption("h", Integer.toString(height));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption http() {
//   return new ImageOption("http", "") {
//     @Override public String apply(String url) {
//       if (url.startsWith("//")) {
//         return "http:" + url;
//       } else {
//         return url;
//       }
//     }
//   };
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption https() {
//   return new ImageOption("https", "") {
//     @Override public String apply(String url) {
//       if (url.startsWith("//")) {
//         return "https:" + url;
//       } else {
//         return url;
//       }
//     }
//   };
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption jpegQualityOf(int quality) {
//   if (quality < 1 || quality > 100) {
//     throw new IllegalArgumentException("Quality has to be in the range from 1 to 100.");
//   }
// 
//   return new ImageOption("q", Integer.toString(quality));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption roundedCornerRadiusOf(float radius) {
//   if (radius < 0) {
//     throw new IllegalArgumentException("Radius is negative.");
//   }
// 
//   return new ImageOption("r", Float.toString(radius));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption widthOf(int width) {
//   if (width <= 0) {
//     throw new IllegalArgumentException("Width has to be positive.");
//   }
//   return new ImageOption("w", Integer.toString(width));
// }


import com.contentful.java.cda.lib.Enqueue;
import org.junit.Test;
import static com.contentful.java.cda.image.ImageOption.Focus.top;
import static com.contentful.java.cda.image.ImageOption.Format.jpg;
import static com.contentful.java.cda.image.ImageOption.Format.png8;
import static com.contentful.java.cda.image.ImageOption.Resize.crop;
import static com.contentful.java.cda.image.ImageOption.backgroundColorOf;
import static com.contentful.java.cda.image.ImageOption.blackBackgroundColor;
import static com.contentful.java.cda.image.ImageOption.fitOf;
import static com.contentful.java.cda.image.ImageOption.focusOn;
import static com.contentful.java.cda.image.ImageOption.formatOf;
import static com.contentful.java.cda.image.ImageOption.heightOf;
import static com.contentful.java.cda.image.ImageOption.http;
import static com.contentful.java.cda.image.ImageOption.https;
import static com.contentful.java.cda.image.ImageOption.jpegQualityOf;
import static com.contentful.java.cda.image.ImageOption.roundedCornerRadiusOf;
import static com.contentful.java.cda.image.ImageOption.widthOf;
import static com.google.common.truth.Truth.assertThat;
    asset.urlForImageWith(backgroundColorOf(0, 0, -1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfBlueColorComponentIsToLarge() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(backgroundColorOf(0, 0, 0xFF + 1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfQualityIsToSmall() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(jpegQualityOf(-1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfQualityIsToHigh() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(jpegQualityOf(0xFFFFFF + 1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfEmptyOption() {
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption backgroundColorOf(int color) {
//   if (color < 0 || color > 0xFFFFFF) {
//     throw new IllegalArgumentException("Color must be in rgb hex range of 0x0 to 0xFFFFFF.");
//   }
//   return new ImageOption("bg", "rgb:" + format(Locale.getDefault(), "%06X", color));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption blackBackgroundColor() {
//   return backgroundColorOf(0);
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption fitOf(Resize resize) {
//   return new ImageOption("fit", resize.name());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption focusOn(Focus focus) {
//   return new ImageOption("f", focus.name());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption formatOf(Format format) {
//   return new ImageOption("fm", format.toUrlParameter());
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption heightOf(int height) {
//   if (height <= 0) {
//     throw new IllegalArgumentException("Height has to be positive.");
//   }
//   return new ImageOption("h", Integer.toString(height));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption http() {
//   return new ImageOption("http", "") {
//     @Override public String apply(String url) {
//       if (url.startsWith("//")) {
//         return "http:" + url;
//       } else {
//         return url;
//       }
//     }
//   };
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption https() {
//   return new ImageOption("https", "") {
//     @Override public String apply(String url) {
//       if (url.startsWith("//")) {
//         return "https:" + url;
//       } else {
//         return url;
//       }
//     }
//   };
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption jpegQualityOf(int quality) {
//   if (quality < 1 || quality > 100) {
//     throw new IllegalArgumentException("Quality has to be in the range from 1 to 100.");
//   }
// 
//   return new ImageOption("q", Integer.toString(quality));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption roundedCornerRadiusOf(float radius) {
//   if (radius < 0) {
//     throw new IllegalArgumentException("Radius is negative.");
//   }
// 
//   return new ImageOption("r", Float.toString(radius));
// }
// 
// Path: src/main/java/com/contentful/java/cda/image/ImageOption.java
// public static ImageOption widthOf(int width) {
//   if (width <= 0) {
//     throw new IllegalArgumentException("Width has to be positive.");
//   }
//   return new ImageOption("w", Integer.toString(width));
// }


// Path: src/test/java/com/contentful/java/cda/AssetTest.java
import com.contentful.java.cda.lib.Enqueue;
import org.junit.Test;
import static com.contentful.java.cda.image.ImageOption.Focus.top;
import static com.contentful.java.cda.image.ImageOption.Format.jpg;
import static com.contentful.java.cda.image.ImageOption.Format.png8;
import static com.contentful.java.cda.image.ImageOption.Resize.crop;
import static com.contentful.java.cda.image.ImageOption.backgroundColorOf;
import static com.contentful.java.cda.image.ImageOption.blackBackgroundColor;
import static com.contentful.java.cda.image.ImageOption.fitOf;
import static com.contentful.java.cda.image.ImageOption.focusOn;
import static com.contentful.java.cda.image.ImageOption.formatOf;
import static com.contentful.java.cda.image.ImageOption.heightOf;
import static com.contentful.java.cda.image.ImageOption.http;
import static com.contentful.java.cda.image.ImageOption.https;
import static com.contentful.java.cda.image.ImageOption.jpegQualityOf;
import static com.contentful.java.cda.image.ImageOption.roundedCornerRadiusOf;
import static com.contentful.java.cda.image.ImageOption.widthOf;
import static com.google.common.truth.Truth.assertThat;

    asset.urlForImageWith(backgroundColorOf(0, 0, -1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfBlueColorComponentIsToLarge() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(backgroundColorOf(0, 0, 0xFF + 1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfQualityIsToSmall() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(jpegQualityOf(-1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfQualityIsToHigh() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");

    asset.urlForImageWith(jpegQualityOf(0xFFFFFF + 1));
  }

  @Test(expected = IllegalArgumentException.class)
  @Enqueue("demo/assets_jake.json")
  public void expectThrowIfEmptyOption() {
    CDAAsset asset = client.fetch(CDAAsset.class).one("jake");