// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/MessageView.java
// @XmlRootElement
// public interface MessageView {
// 
//     @XmlElement
//     String getContent();
//     
//     @XmlElement
//     AuthorView getAuthorView();
//     
//     @XmlAttribute
//     LocalDateTime getTime();
//     
//     String getAuthorNick();
// }
// 
// Path: airomem-core/src/main/java/pl/setblack/airomem/core/PrevalanceContext.java
// public class PrevalanceContext {
// 
//     /**
//      * Use this time object whenewer actual time was needed in command.
//      */
//     public final Instant time;
// 
//     public final boolean safe;
// 
//     public PrevalanceContext(final Date date) {
//         this(date.toInstant(), false);
//     }
// 
//     private PrevalanceContext(final Instant time, final boolean safe) {
//         this.time = time;
//         this.safe = safe;
//     }
// 
//     public PrevalanceContext safe() {
//         return new PrevalanceContext(this.time, true);
//     }
// 
//     public PrevalanceContext unsafe() {
//         return new PrevalanceContext(this.time, false);
//     }
// }
// 
// Path: airomem-core/src/main/java/pl/setblack/airomem/core/WriteChecker.java
// public class WriteChecker {
// 
//     private static final ThreadLocal<PrevalanceContext> CONTEXT_STORE = new ThreadLocal<>();
// 
//     public static void setContext(final PrevalanceContext ctx) {
//         assert !hasPrevalanceContext() : "Context was initialized before";
//         CONTEXT_STORE.set(ctx);
//     }
// 
//     public static PrevalanceContext getContext() {
//         return CONTEXT_STORE.get();
//     }
// 
//     public static void clearContext() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         CONTEXT_STORE.remove();
//     }
// 
//     public static boolean hasPrevalanceContext() {
//         return CONTEXT_STORE.get() != null;
//     }
// 
//     public static void enterSafe() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         assert !getContext().safe : "context cannot be safe before";
//         CONTEXT_STORE.set(getContext().safe());
//     }
// 
//     public static void leaveSafe() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         assert getContext().safe : "context must be safe before";
// 
//         CONTEXT_STORE.set(getContext().unsafe());
//     }
// 
// }


import java.time.LocalDateTime;
import java.time.Month;
import java.util.List;
import org.junit.After;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import pl.setblack.airomem.chatsample.view.MessageView;
import pl.setblack.airomem.core.PrevalanceContext;
import pl.setblack.airomem.core.WriteChecker;

/*
 *  Created by Jarek Ratajski
 */
package pl.setblack.airomem.chatsample.data;


/**
 *
 * @author jarek ratajski
 */
public class ChatTest {

    private static final String SAMPLE_CONTENT = "sample content";

    private Chat chat;

    private LocalDateTime time;

    public ChatTest() {
    }

    @Before
    public void setUp() {
        this.chat = new Chat();
        this.time = LocalDateTime.now();

// Path: airomem-chatsample/airomem-chatsample-view/src/main/java/pl/setblack/airomem/chatsample/view/MessageView.java
// @XmlRootElement
// public interface MessageView {
// 
//     @XmlElement
//     String getContent();
//     
//     @XmlElement
//     AuthorView getAuthorView();
//     
//     @XmlAttribute
//     LocalDateTime getTime();
//     
//     String getAuthorNick();
// }
// 
// Path: airomem-core/src/main/java/pl/setblack/airomem/core/PrevalanceContext.java
// public class PrevalanceContext {
// 
//     /**
//      * Use this time object whenewer actual time was needed in command.
//      */
//     public final Instant time;
// 
//     public final boolean safe;
// 
//     public PrevalanceContext(final Date date) {
//         this(date.toInstant(), false);
//     }
// 
//     private PrevalanceContext(final Instant time, final boolean safe) {
//         this.time = time;
//         this.safe = safe;
//     }
// 
//     public PrevalanceContext safe() {
//         return new PrevalanceContext(this.time, true);
//     }
// 
//     public PrevalanceContext unsafe() {
//         return new PrevalanceContext(this.time, false);
//     }
// }
// 
// Path: airomem-core/src/main/java/pl/setblack/airomem/core/WriteChecker.java
// public class WriteChecker {
// 
//     private static final ThreadLocal<PrevalanceContext> CONTEXT_STORE = new ThreadLocal<>();
// 
//     public static void setContext(final PrevalanceContext ctx) {
//         assert !hasPrevalanceContext() : "Context was initialized before";
//         CONTEXT_STORE.set(ctx);
//     }
// 
//     public static PrevalanceContext getContext() {
//         return CONTEXT_STORE.get();
//     }
// 
//     public static void clearContext() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         CONTEXT_STORE.remove();
//     }
// 
//     public static boolean hasPrevalanceContext() {
//         return CONTEXT_STORE.get() != null;
//     }
// 
//     public static void enterSafe() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         assert !getContext().safe : "context cannot be safe before";
//         CONTEXT_STORE.set(getContext().safe());
//     }
// 
//     public static void leaveSafe() {
//         assert hasPrevalanceContext() : "Context has to be initialized first";
//         assert getContext().safe : "context must be safe before";
// 
//         CONTEXT_STORE.set(getContext().unsafe());
//     }
// 
// }


// Path: airomem-chatsample/airomem-chatsample-data/src/test/java/pl/setblack/airomem/chatsample/data/ChatTest.java
import java.time.LocalDateTime;
import java.time.Month;
import java.util.List;
import org.junit.After;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import pl.setblack.airomem.chatsample.view.MessageView;
import pl.setblack.airomem.core.PrevalanceContext;
import pl.setblack.airomem.core.WriteChecker;

/*
 *  Created by Jarek Ratajski
 */
package pl.setblack.airomem.chatsample.data;


/**
 *
 * @author jarek ratajski
 */
public class ChatTest {

    private static final String SAMPLE_CONTENT = "sample content";

    private Chat chat;

    private LocalDateTime time;

    public ChatTest() {
    }

    @Before
    public void setUp() {
        this.chat = new Chat();
        this.time = LocalDateTime.now();

        WriteChecker.setContext(Mockito.mock(PrevalanceContext.class));
