// Path: src/test/java/org/cri/redmetrics/model/Players.java
// public class Players {
// 
//     public static TestPlayer newJohnSnow() {
//         return new PlayerBuilder().withNewRandomExternalId().withGender(Gender.MALE).withRegion("South").withCountry("The North").build();
//     }
// 
// }
// 
// 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/model/TestPlayer.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestPlayer extends TestEntity {
// 
//     @Key
//     private String birthDate;
// 
//     @Key
//     private String region;
// 
//     @Key
//     private String country;
// 
//     @Key
//     private String gender;
// 
//     @Key
//     private String externalId;
// }


import org.cri.redmetrics.model.Players;
import org.cri.redmetrics.model.TestGame;
import org.cri.redmetrics.model.TestGameVersion;
import org.cri.redmetrics.model.TestPlayer;
import java.io.IOException;
package org.cri.redmetrics.backend;



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");
// Path: src/test/java/org/cri/redmetrics/model/Players.java
// public class Players {
// 
//     public static TestPlayer newJohnSnow() {
//         return new PlayerBuilder().withNewRandomExternalId().withGender(Gender.MALE).withRegion("South").withCountry("The North").build();
//     }
// 
// }
// 
// 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/model/TestPlayer.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// @ToString(callSuper = true)
// public class TestPlayer extends TestEntity {
// 
//     @Key
//     private String birthDate;
// 
//     @Key
//     private String region;
// 
//     @Key
//     private String country;
// 
//     @Key
//     private String gender;
// 
//     @Key
//     private String externalId;
// }


// Path: src/test/java/org/cri/redmetrics/backend/Backends.java
import org.cri.redmetrics.model.Players;
import org.cri.redmetrics.model.TestGame;
import org.cri.redmetrics.model.TestGameVersion;
import org.cri.redmetrics.model.TestPlayer;
import java.io.IOException;

package org.cri.redmetrics.backend;



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);