@@ -0,0 +1,3128 @@
+/*%0A * The MIT License%0A *%0A * Copyright (c) 2016 Marcelo %22Ataxexe%22 Guimar%C3%A3es %3Cataxexe@devnull.tools%3E%0A *%0A * Permission  is hereby granted, free of charge, to any person obtaining%0A * a  copy  of  this  software  and  associated  documentation files (the%0A * %22Software%22),  to  deal  in the Software without restriction, including%0A * without  limitation  the  rights to use, copy, modify, merge, publish,%0A * distribute,  sublicense,  and/or  sell  copies of the Software, and to%0A * permit  persons to whom the Software is furnished to do so, subject to%0A * the following conditions:%0A * The  above  copyright  notice  and  this  permission  notice  shall be%0A * included  in  all  copies  or  substantial  portions  of the Software.%0A *%0A * THE  SOFTWARE  IS  PROVIDED  %22AS  IS%22,  WITHOUT  WARRANTY OF ANY KIND,%0A * EXPRESS  OR  IMPLIED,  INCLUDING  BUT NOT LIMITED TO THE WARRANTIES OF%0A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.%0A * IN  NO  EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY%0A * CLAIM,  DAMAGES  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,%0A * TORT  OR  OTHERWISE,  ARISING  FROM,  OUT OF OR IN CONNECTION WITH THE%0A * SOFTWARE   OR   THE   USE   OR   OTHER   DEALINGS  IN  THE  SOFTWARE.%0A */%0A%0Apackage tools.devnull.boteco.persistence.user;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport tools.devnull.boteco.Destination;%0Aimport tools.devnull.boteco.InvalidDestinationException;%0Aimport tools.devnull.boteco.MessageDestination;%0Aimport tools.devnull.boteco.user.User;%0Aimport tools.devnull.kodo.TestScenario;%0A%0Aimport java.util.List;%0Aimport java.util.function.Consumer;%0Aimport java.util.function.Predicate;%0A%0Aimport static tools.devnull.kodo.Spec.be;%0Aimport static tools.devnull.kodo.Spec.have;%0Aimport static tools.devnull.kodo.Spec.raise;%0Aimport static tools.devnull.kodo.Spec.should;%0A%0Apublic class BotecoUserTest %7B%0A%0A  private User user;%0A  private MessageDestination defaultDestination;%0A  private MessageDestination secondaryDestination;%0A%0A  @Before%0A  public void initialize() %7B%0A    defaultDestination = Destination.channel(%22mychannel%22).to(%22myuser%22);%0A    secondaryDestination = Destination.channel(%22secondary_channel%22).to(%22myuser%22);%0A    user = new BotecoUser(%22user%22, defaultDestination);%0A    user.addDestination(secondaryDestination);%0A  %7D%0A%0A  @Test%0A  public void testConstructor() %7B%0A    TestScenario.given(user)%0A        .the(User::id, should(be(%22user%22)))%0A        .the(User::defaultDestination, should(be(defaultDestination)))%0A        .the(User::destinations, should(have(twoElements())));%0A  %7D%0A%0A  @Test%0A  public void testRemoveDestination() %7B%0A    TestScenario.given(user)%0A        .then(removing(defaultDestination), should(raise(InvalidDestinationException.class)))%0A%0A        .when(removing(secondaryDestination))%0A        .the(User::destinations, should(have(oneElement())));%0A  %7D%0A%0A  private Predicate%3CList%3E oneElement() %7B%0A    return list -%3E list.size() == 1;%0A  %7D%0A%0A  private Predicate%3CList%3E twoElements() %7B%0A    return list -%3E list.size() == 2;%0A  %7D%0A%0A  private Consumer%3CUser%3E removing(MessageDestination destination) %7B%0A    return u -%3E u.removeDestination(destination);%0A  %7D%0A%0A%7D%0A

add tests to boteco user class