<commit_before>package com.jos.dem.vetlog.service;

import com.jos.dem.vetlog.client.GoogleStorageWriter;
import com.jos.dem.vetlog.command.PetCommand;
import com.jos.dem.vetlog.command.PetLogCommand;
import com.jos.dem.vetlog.service.impl.PetPrescriptionServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.InputStream;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@Slf4j
class PetPrescriptionServiceTest {

    public static final String CONTENT_TYPE = "application/octet-stream";

    private PetPrescriptionService service;

    @Mock private GoogleStorageWriter googleStorageWriter;

    @BeforeEach
    void setup(){
        MockitoAnnotations.openMocks(this);
        service = new PetPrescriptionServiceImpl(googleStorageWriter);
    }

    @Test
    @DisplayName("saving a pet image")
    void shouldSavePetImage(TestInfo testInfo) throws IOException {
        log.info("Running: {}", testInfo.getDisplayName());
        PetLogCommand petLogCommand = new PetLogCommand();
        MultipartFile multiPartFile = mock(MultipartFile.class);
        InputStream inputStream = mock(InputStream.class);
        when(inputStream.available()).thenReturn(1000);
        when(multiPartFile.getInputStream()).thenReturn(inputStream);
        petLogCommand.setAttachment(multiPartFile);<commit_msg>#172 Fixing test<commit_after>package com.jos.dem.vetlog.service;

import com.jos.dem.vetlog.client.GoogleStorageWriter;
import com.jos.dem.vetlog.command.PetLogCommand;
import com.jos.dem.vetlog.service.impl.PetPrescriptionServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.InputStream;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@Slf4j
class PetPrescriptionServiceTest {

    private PetPrescriptionService service;

    @Mock
    private GoogleStorageWriter googleStorageWriter;

    @BeforeEach
    void setup() {
        MockitoAnnotations.openMocks(this);
        service = new PetPrescriptionServiceImpl(googleStorageWriter);
    }

    @Test
    @DisplayName("saving a pet image")
    void shouldSavePetImage(TestInfo testInfo) throws IOException {
        log.info("Running: {}", testInfo.getDisplayName());
        PetLogCommand petLogCommand = new PetLogCommand();
        MultipartFile multiPartFile = mock(MultipartFile.class);
        InputStream inputStream = mock(InputStream.class);
        when(inputStream.available()).thenReturn(1000);
        when(multiPartFile.getInputStream()).thenReturn(inputStream);
        petLogCommand.setAttachment(multiPartFile);
{'fraction_non_alphanumeric': 0.09800617803987643, 'fraction_numerical': 0.004773939904521202, 'mean_word_length': 4.9267886855241265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3142221', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1038, 'n_words': 185}