Package com.google.sitebricks.acceptance

Source Code of com.google.sitebricks.acceptance.ConnegAcceptanceTest

package com.google.sitebricks.acceptance;

import com.google.common.collect.ImmutableMap;
import com.google.sitebricks.acceptance.page.ConnegPage;
import com.google.sitebricks.acceptance.util.AcceptanceTest;
import org.testng.annotations.Test;

/**
* @author Dhanji R. Prasanna (dhanji@gmail.com)
*/
@Test(suiteName = AcceptanceTest.SUITE)
public class ConnegAcceptanceTest {

  public void shouldReturnGifByDefault() {
    ConnegPage page = ConnegPage.openWithHeaders(ImmutableMap.<String, String>of());

    assert page.hasContent("GIF")
        : "Did not have gif!";
  }

  public void shouldReturnJpeg() {
    ConnegPage page = ConnegPage.openWithHeaders(ImmutableMap.of("Accept", "image/jpeg"));

    assert page.hasContent("JPEG")
        : "Did not have jpeg!";
  }

  public void shouldReturnPng() {
    ConnegPage page = ConnegPage.openWithHeaders(ImmutableMap.of("Accept", "image/png"));

    assert page.hasContent("PNG")
        : "Did not have jpeg!";
  }

  public void shouldReturnPngOrJpeg() {
    ConnegPage page = ConnegPage.openWithHeaders(ImmutableMap.of("Accept", "image/png, image/jpeg"));

    assert page.hasContent("PNG") || page.hasContent("JPEG")
        : "Did not have jpeg!";
  }
}
TOP

Related Classes of com.google.sitebricks.acceptance.ConnegAcceptanceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.