<commit_before>package com.jvm_bloggers.domain.query.unread_varia_suggestion

import com.jvm_bloggers.entities.varia_suggestion.VariaSuggestion
import com.jvm_bloggers.entities.varia_suggestion.VariaSuggestionRepository
import io.vavr.collection.List
import spock.lang.Specification
import spock.lang.Subject

class UnreadVariaSuggestionQuerySpec extends Specification {

    VariaSuggestionRepository variaSuggestionRepository = Stub()

    @Subject
    UnreadVariaSuggestionQuery unreadVariaSuggestionQuery = new UnreadVariaSuggestionQuery(variaSuggestionRepository)

    def "Should find unread VariaSuggestions"() {
        given:
        VariaSuggestion variaSuggestion = new VariaSuggestion('url', 'reason', 'author')

        when:
        variaSuggestionRepository.findByReadFalseOrReadNull(_) >> List.of(variaSuggestion)

        then:
        unreadVariaSuggestionQuery.findUnreadSuggestions(0, 10).size() == 1
    }
}<commit_msg>Moved @Subject to comply with rest of the files<commit_after>package com.jvm_bloggers.domain.query.unread_varia_suggestion

import com.jvm_bloggers.entities.varia_suggestion.VariaSuggestion
import com.jvm_bloggers.entities.varia_suggestion.VariaSuggestionRepository
import io.vavr.collection.List
import spock.lang.Specification
import spock.lang.Subject

@Subject(UnreadVariaSuggestionQuery)
class UnreadVariaSuggestionQuerySpec extends Specification {

    UnreadVariaSuggestionQuery unreadVariaSuggestionQuery = new UnreadVariaSuggestionQuery(variaSuggestionRepository)

    VariaSuggestionRepository variaSuggestionRepository = Stub()

    def "Should find unread VariaSuggestions"() {
        given:
        VariaSuggestion variaSuggestion = new VariaSuggestion('url', 'reason', 'author')

        when:
        variaSuggestionRepository.findByReadFalseOrReadNull(_) >> List.of(variaSuggestion)

        then:
        unreadVariaSuggestionQuery.findUnreadSuggestions(0, 10).size() == 1
    }
}
{'fraction_non_alphanumeric': 0.0717234262125903, 'fraction_numerical': 0.0041279669762641896, 'mean_word_length': 5.399339933993399, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7397473', 'n_tokens_mistral': 632, 'n_tokens_neox': 577, 'n_words': 94}