// Path: src/test/java/org/cri/redmetrics/backend/Backends.java
// public class Backends {
// 
//     public static final EventBackend EVENT = new EventBackend();
//     public static final GameBackend GAME = new GameBackend();
//     public static final GameVersionBackend GAME_VERSION = new GameVersionBackend();
//     public static final GroupBackend GROUP = new GroupBackend();
//     public static final PlayerBackend PLAYER = new PlayerBackend();
//     public static final SnapshotBackend SNAPSHOT = new SnapshotBackend();
//     private static int gameNo = 0;
//     
//     public static TestGame newSavedGame() {
//         
//         try {
//             TestGame game = new TestGame();
//             game.setName("My Test Game " + gameNo);
//             ++gameNo;
//             TestGame savedGame = GAME.post(game);
//             return savedGame;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     public static TestGameVersion newSavedGameVersion() {
//         try {
//             TestGame game = newSavedGame();
//             TestGameVersion gameVersion = new TestGameVersion();
//             gameVersion.setGame(game.getId());
//             gameVersion.setName("version 1");
//             gameVersion = GAME_VERSION.post(gameVersion);
//             return gameVersion;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     public static TestPlayer newSavedPlayer() {
//         try {
//             TestPlayer player = Players.newJohnSnow();
//             TestPlayer savedPlayer = PLAYER.post(player);
//             return savedPlayer;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
//     
// }
// 
// Path: src/test/java/org/cri/redmetrics/backend/GameBackend.java
// public class GameBackend extends HttpBackend<TestGame> {
// 
//     GameBackend() {
//         super("game", TestGame.class);
//     }
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/backend/GameVersionBackend.java
// public class GameVersionBackend extends HttpBackend<TestGameVersion> {
// 
//     GameVersionBackend() {
//         super("gameVersion", TestGameVersion.class);
//     }
// 
//     public List<TestGameVersion> getGameVersions(String gameId) throws IOException {
//         GenericUrl url = new GenericUrl(BASE_PATH + "game/" + gameId + "/versions");
//         return (List<TestGameVersion>) requestFactory.buildGetRequest(url).execute().parseAs(arrayType);
//     }
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/model/TestGame.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestGame extends TestEntity {
// 
//     @Key
//     private String adminKey;
// 
//     @Key
//     private String name;
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/model/TestGameVersion.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestGameVersion extends TestEntity {
// 
//     @Key
//     private String game;
// 
//     @Key
//     private String name = "v1";
// 
// }


import com.google.api.client.http.HttpResponseException;
import org.cri.redmetrics.backend.Backends;
import org.cri.redmetrics.backend.GameBackend;
import org.cri.redmetrics.backend.GameVersionBackend;
import org.cri.redmetrics.model.TestGame;
import org.cri.redmetrics.model.TestGameVersion;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.failBecauseExceptionWasNotThrown;
package org.cri.redmetrics;




public class GameBackendTest {

    static final GameBackend games = Backends.GAME;
    static final GameVersionBackend gameVersions = Backends.GAME_VERSION;

    static final String GAME_NAME = "Asteroids";
// Path: src/test/java/org/cri/redmetrics/backend/Backends.java
// public class Backends {
// 
//     public static final EventBackend EVENT = new EventBackend();
//     public static final GameBackend GAME = new GameBackend();
//     public static final GameVersionBackend GAME_VERSION = new GameVersionBackend();
//     public static final GroupBackend GROUP = new GroupBackend();
//     public static final PlayerBackend PLAYER = new PlayerBackend();
//     public static final SnapshotBackend SNAPSHOT = new SnapshotBackend();
//     private static int gameNo = 0;
//     
//     public static TestGame newSavedGame() {
//         
//         try {
//             TestGame game = new TestGame();
//             game.setName("My Test Game " + gameNo);
//             ++gameNo;
//             TestGame savedGame = GAME.post(game);
//             return savedGame;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     public static TestGameVersion newSavedGameVersion() {
//         try {
//             TestGame game = newSavedGame();
//             TestGameVersion gameVersion = new TestGameVersion();
//             gameVersion.setGame(game.getId());
//             gameVersion.setName("version 1");
//             gameVersion = GAME_VERSION.post(gameVersion);
//             return gameVersion;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     public static TestPlayer newSavedPlayer() {
//         try {
//             TestPlayer player = Players.newJohnSnow();
//             TestPlayer savedPlayer = PLAYER.post(player);
//             return savedPlayer;
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
//     
// }
// 
// Path: src/test/java/org/cri/redmetrics/backend/GameBackend.java
// public class GameBackend extends HttpBackend<TestGame> {
// 
//     GameBackend() {
//         super("game", TestGame.class);
//     }
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/backend/GameVersionBackend.java
// public class GameVersionBackend extends HttpBackend<TestGameVersion> {
// 
//     GameVersionBackend() {
//         super("gameVersion", TestGameVersion.class);
//     }
// 
//     public List<TestGameVersion> getGameVersions(String gameId) throws IOException {
//         GenericUrl url = new GenericUrl(BASE_PATH + "game/" + gameId + "/versions");
//         return (List<TestGameVersion>) requestFactory.buildGetRequest(url).execute().parseAs(arrayType);
//     }
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/model/TestGame.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestGame extends TestEntity {
// 
//     @Key
//     private String adminKey;
// 
//     @Key
//     private String name;
// 
// }
// 
// Path: src/test/java/org/cri/redmetrics/model/TestGameVersion.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestGameVersion extends TestEntity {
// 
//     @Key
//     private String game;
// 
//     @Key
//     private String name = "v1";
// 
// }


// Path: src/test/java/org/cri/redmetrics/GameBackendTest.java
import com.google.api.client.http.HttpResponseException;
import org.cri.redmetrics.backend.Backends;
import org.cri.redmetrics.backend.GameBackend;
import org.cri.redmetrics.backend.GameVersionBackend;
import org.cri.redmetrics.model.TestGame;
import org.cri.redmetrics.model.TestGameVersion;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.failBecauseExceptionWasNotThrown;

package org.cri.redmetrics;




public class GameBackendTest {

    static final GameBackend games = Backends.GAME;
    static final GameVersionBackend gameVersions = Backends.GAME_VERSION;

    static final String GAME_NAME = "Asteroids";
    static final String UPDATED_GAME_NAME = "Gasteroids";