Package com.nebhale.letsmakeadeal

Examples of com.nebhale.letsmakeadeal.GameDoesNotExistException


        synchronized (this.monitor) {
            if (this.games.containsKey(id)) {
                return this.games.get(id);
            }

            throw new GameDoesNotExistException(id);
        }
    }
View Full Code Here


    public void remove(Long id) throws GameDoesNotExistException {
        synchronized (this.monitor) {
            if (this.games.containsKey(id)) {
                this.games.remove(id);
            } else {
                throw new GameDoesNotExistException(id);
            }
        }

    }
View Full Code Here

        .andExpect(jsonPath("$.links[?(@.rel==doors)].href[0]").value(GAME_LOCATION + "/doors"));
    }

    @Test
    public void showGameGameDoesNotExist() throws Exception {
        when(this.gameRepository.retrieve(0L)).thenThrow(new GameDoesNotExistException(0L));

        this.mockMvc.perform(get(GAME_LOCATION).accept(MediaType.APPLICATION_JSON)) //
        .andExpect(status().isNotFound()) //
        .andExpect(content().string("Game '0' does not exist"));
    }
View Full Code Here

        verify(this.gameRepository).remove(0L);
    }

    @Test
    public void destroyGameGameDoesNotExist() throws Exception {
        doThrow(new GameDoesNotExistException(0L)).when(this.gameRepository).remove(0L);

        this.mockMvc.perform(delete(GAME_LOCATION)) //
        .andExpect(status().isNotFound()) //
        .andExpect(content().string("Game '0' does not exist"));
    }
View Full Code Here

        .andExpect(jsonPath("$.links[?(@.rel==self)].href[0]").value(DOORS_LOCATION));
    }

    @Test
    public void showDoorsGameDoesNotExist() throws Exception {
        when(this.gameRepository.retrieve(0L)).thenThrow(new GameDoesNotExistException(0L));

        this.mockMvc.perform(get(DOORS_LOCATION)) //
        .andExpect(status().isNotFound()) //
        .andExpect(content().string("Game '0' does not exist"));
    }
View Full Code Here

        .andExpect(content().string("Payload is missing key 'status'"));
    }

    @Test
    public void modifyDoorGameDoesNotExist() throws Exception {
        when(this.gameRepository.retrieve(0L)).thenThrow(new GameDoesNotExistException(0L));

        this.mockMvc.perform(
            post(DOOR_LOCATION).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).content(
                getBytes("{ \"status\" : \"SELECTED\" }"))) //
        .andExpect(status().isNotFound()) //
View Full Code Here

TOP

Related Classes of com.nebhale.letsmakeadeal.GameDoesNotExistException

Copyright © 2018 www.massapicom. 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.