package core.framework.mongo.impl;

import com.mongodb.MongoClient;
import com.mongodb.client.model.Filters;
import org.junit.jupiter.api.Test;

import java.util.Set;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author neo
 */
class BsonLogParamTest {
    @Test
    void append() {
        var param = new BsonLogParam(Filters.eq("field", "value"), MongoClient.getDefaultCodecRegistry());
        var builder = new StringBuilder();
        param.append(builder, Set.of(), 1000);
        assertThat(builder.toString()).isEqualTo("{ \"field\" : \"value\" }");
    }
}

@@ -546,17 +546,16 @@
 ualTo(%22%7B
- 
 %5C%22field%5C
@@ -555,17 +555,16 @@
 %22field%5C%22
- 
 : %5C%22valu
@@ -566,17 +566,16 @@
 %22value%5C%22
- 
 %7D%22);%0A   

fix unit test