content: package com.codesoom.demo.domain;
  
  import org.junit.jupiter.api.Test;
  
  import static org.assertj.core.api.Assertions.assertThat;
  import static org.junit.jupiter.api.Assertions.*;
  
  class UserTest {
      @Test
      void changeWith() {
          User user = User.builder().build();
  
          user.changeWith(User.builder()
                  .name("TEST")
                  .password("TEST")
                  .build());
  
          assertThat(user.getName()).isEqualTo("TEST");
          assertThat(user.getPassword()).isEqualTo("TEST");
      }
  
      @Test
      void destroy() {
          User user = User.builder().build();
  
          assertThat(user.isDeleted()).isFalse();
  
          user.destroy();
  
          assertThat(user.isDeleted()).isTrue();
      }
  
      @Test
      void authenticate() {
          User user = User.builder()
                  .password("test")
                  .build();
  
          assertThat(user.authenticate("test")).isTrue();
          assertThat(user.authenticate("xxx")).isFalse();
      }
  
      @Test
      void authenticateWithDeletedUser() {
          User user = User.builder()
                  .password("test")
                  .deleted(true)
                  .build();
  
          assertThat(user.authenticate("test")).isFalse();
          assertThat(user.authenticate("xxx")).isFalse();
      }
  }
  