// Path: src/main/java/no/asgari/civilization/server/dto/MessageDTO.java
// public class MessageDTO {
// 
//     private final String message;
// 
//     @JsonCreator
//     public MessageDTO(@JsonProperty("msg") String message) {
//         this.message = message;
//     }
// 
//     @JsonProperty("msg")
//     public String getMessage() {
//         return message;
//     }
// 
// }
// 
// Path: src/main/java/no/asgari/civilization/server/model/Playerhand.java
// @Data
// @JsonRootName("players")
// @NoArgsConstructor
// @EqualsAndHashCode(of = {"username", "playerId"})
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Playerhand implements Comparable<Playerhand> {
//     @NotBlank
//     //Can consider using the playerId instead or removing @NotBlank
//     private String username;
// 
//     @NotBlank
//     private String playerId;
// 
//     private String email;
// 
//     private String color;
// 
//     private Civ civilization; //The chosen civilization
// 
//     /**
//      * Save personal gamenotes
//      **/
//     private String gamenote;
// 
//     //Only one starting player each turn
//     /**
//      * Determines whos turn it is each round *
//      */
//     private boolean yourTurn = false;
//     /**
//      * Determines player order (ie: Player 2)
//      */
//     private int playernumber;
//     private boolean gameCreator = false;
// 
//     private List<Item> items = new ArrayList<>();
//     private Set<Tech> techsChosen = new TreeSet<>();
//     private List<Unit> barbarians = new ArrayList<>(3);
//     private List<Unit> battlehand = new ArrayList<>();
//     private List<SocialPolicy> socialPolicies = new ArrayList<>();
//     /**
//      * Private turns, only made public when they are locked
//      */
//     private Set<PlayerTurn> playerTurns = new TreeSet<>();
// 
//     @JsonSerialize(using = LocalDateTimeSerializer.class)
//     @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//     private LocalDateTime emailSent;
// 
//     @JsonIgnore
//     public static String green() {
//         return "Green";
//     }
// 
//     @JsonIgnore
//     public static String yellow() {
//         return "Yellow";
//     }
// 
//     @JsonIgnore
//     public static String purple() {
//         return "Purple";
//     }
// 
//     @JsonIgnore
//     public static String red() {
//         return "Red";
//     }
// 
//     @JsonIgnore
//     public static String blue() {
//         return "Blue";
//     }
// 
//     @JsonIgnore
//     public Optional<LocalDateTime> getIfEmailSent() {
//         return Optional.ofNullable(emailSent);
//     }
// 
//     @Override
//     public int compareTo(Playerhand o) {
//         return o.getUsername().compareTo(o.getUsername());
//     }
// }


import no.asgari.civilization.server.dto.MessageDTO;
import no.asgari.civilization.server.model.Playerhand;
import org.junit.Test;
import javax.ws.rs.core.Response;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.time.ZoneId;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
package no.asgari.civilization.server.misc;




public class MiscTest {

    @Test
    public void checkDecoding() throws Exception {
        String encodedText = "http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab";
        String decodedText = URLDecoder.decode(encodedText, "UTF-8");
        assertThat(decodedText).isEqualTo("http://w3schools.com/my test.asp?name=ståle&car=saab");

        encodedText = "Lets%20get%20going%20foobars";
// Path: src/main/java/no/asgari/civilization/server/dto/MessageDTO.java
// public class MessageDTO {
// 
//     private final String message;
// 
//     @JsonCreator
//     public MessageDTO(@JsonProperty("msg") String message) {
//         this.message = message;
//     }
// 
//     @JsonProperty("msg")
//     public String getMessage() {
//         return message;
//     }
// 
// }
// 
// Path: src/main/java/no/asgari/civilization/server/model/Playerhand.java
// @Data
// @JsonRootName("players")
// @NoArgsConstructor
// @EqualsAndHashCode(of = {"username", "playerId"})
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Playerhand implements Comparable<Playerhand> {
//     @NotBlank
//     //Can consider using the playerId instead or removing @NotBlank
//     private String username;
// 
//     @NotBlank
//     private String playerId;
// 
//     private String email;
// 
//     private String color;
// 
//     private Civ civilization; //The chosen civilization
// 
//     /**
//      * Save personal gamenotes
//      **/
//     private String gamenote;
// 
//     //Only one starting player each turn
//     /**
//      * Determines whos turn it is each round *
//      */
//     private boolean yourTurn = false;
//     /**
//      * Determines player order (ie: Player 2)
//      */
//     private int playernumber;
//     private boolean gameCreator = false;
// 
//     private List<Item> items = new ArrayList<>();
//     private Set<Tech> techsChosen = new TreeSet<>();
//     private List<Unit> barbarians = new ArrayList<>(3);
//     private List<Unit> battlehand = new ArrayList<>();
//     private List<SocialPolicy> socialPolicies = new ArrayList<>();
//     /**
//      * Private turns, only made public when they are locked
//      */
//     private Set<PlayerTurn> playerTurns = new TreeSet<>();
// 
//     @JsonSerialize(using = LocalDateTimeSerializer.class)
//     @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//     private LocalDateTime emailSent;
// 
//     @JsonIgnore
//     public static String green() {
//         return "Green";
//     }
// 
//     @JsonIgnore
//     public static String yellow() {
//         return "Yellow";
//     }
// 
//     @JsonIgnore
//     public static String purple() {
//         return "Purple";
//     }
// 
//     @JsonIgnore
//     public static String red() {
//         return "Red";
//     }
// 
//     @JsonIgnore
//     public static String blue() {
//         return "Blue";
//     }
// 
//     @JsonIgnore
//     public Optional<LocalDateTime> getIfEmailSent() {
//         return Optional.ofNullable(emailSent);
//     }
// 
//     @Override
//     public int compareTo(Playerhand o) {
//         return o.getUsername().compareTo(o.getUsername());
//     }
// }


// Path: src/test/java/no/asgari/civilization/server/misc/MiscTest.java
import no.asgari.civilization.server.dto.MessageDTO;
import no.asgari.civilization.server.model.Playerhand;
import org.junit.Test;
import javax.ws.rs.core.Response;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.time.ZoneId;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

package no.asgari.civilization.server.misc;




public class MiscTest {

    @Test
    public void checkDecoding() throws Exception {
        String encodedText = "http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab";
        String decodedText = URLDecoder.decode(encodedText, "UTF-8");
        assertThat(decodedText).isEqualTo("http://w3schools.com/my test.asp?name=ståle&car=saab");

        encodedText = "Lets%20get%20going%20foobars";
        decodedText = URLDecoder.decode(encodedText, "UTF-8");