<commit_before>package org.risk.client;

import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.risk.client.GameApi.Operation;
import org.risk.client.GameApi.Set;
import org.risk.client.GameApi.EndGame;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

/**
 * This class checks for endgame operations.
 * @author vishal
 *
 */
public class EndGameTest extends AbstractTest {
  /*
   * This test checks for valid end game scenario
   */
  @Test
  public void testEndGameByC() {
    Map<String, Object> state = ImmutableMap.<String, Object>builder()
        .put(TURN, PLAYER_C)
        .put(PHASE, END_GAME)
        .put(PLAYER_A, ImmutableMap.<String, Object>of(
            CARDS, emptyListInt,
            TERRITORY, emptyMap,
            UNCLAIMED_UNITS, 0,
            CONTINENT, emptyListString))
        .put(PLAYER_C, ImmutableMap.<String, Object>of(
            CARDS, emptyListInt,
            TERRITORY, getTerritoriesInRange(0, 41),
            UNCLAIMED_UNITS, 0,
            CONTINENT, emptyListString))
        .put(TURN_ORDER, ImmutableList.<String>of(PLAYER_C, PLAYER_A))
        .put(CARDS, getCardsInRange(0, 43))
        .build();
        
    List<Operation> claimEndGameByC = ImmutableList.<Operation>of(
        new EndGame(cId));

    assertMoveOk(move(cId, state, claimEndGameByC));
    <commit_msg>EndGameTest fixed<commit_after>package org.risk.client;

import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.risk.client.GameApi.Operation;
import org.risk.client.GameApi.Set;
import org.risk.client.GameApi.EndGame;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

/**
 * This class checks for endgame operations.
 * @author vishal
 *
 */
public class EndGameTest extends AbstractTest {
  /*
   * This test checks for valid end game scenario
   */
  @Test
  public void testEndGameByC() {
    Map<String, Object> state = ImmutableMap.<String, Object>builder()
        .put(TURN, PLAYER_C)
        .put(PHASE, END_GAME)
        .put(PLAYER_C, ImmutableMap.<String, Object>of(
            CARDS, emptyListInt,
            TERRITORY, getTerritoriesInRange(0, 41),
            UNCLAIMED_UNITS, 0,
            CONTINENT, emptyListString))
        .put(TURN_ORDER, ImmutableList.<String>of(PLAYER_C))
        .put(CARDS, getCardsInRange(0, 43))
        .build();
        
    List<Operation> claimEndGameByC = ImmutableList.<Operation>of(
        new EndGame(cId));

    assertMoveOk(move(cId, state, claimEndGameByC));
    
{'fraction_non_alphanumeric': 0.11201235998455002, 'fraction_numerical': 0.005793742757821553, 'mean_word_length': 3.0595611285266457, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7574604', 'n_tokens_mistral': 880, 'n_tokens_neox': 844, 'n_words': 169}