<commit_before><commit_msg>Added test for jiraConnector<commit_after>package org.karivar.utils;

import com.atlassian.jira.rest.client.api.IssueRestClient;
import mockit.Deencapsulation;
import mockit.Injectable;
import mockit.Tested;
import org.junit.*;
import org.karivar.utils.other.UTF8Control;

import java.net.URI;
import java.util.*;

import static org.junit.Assert.*;


public class JiraConnectorTest {

    @Tested
    private JiraConnector jiraConnector;

    @Injectable
    private static ResourceBundle resourceBundle;

    @Injectable
    private IssueRestClient issueRestClient;

    @BeforeClass
    public static void setUpClass() {
        resourceBundle = ResourceBundle.getBundle("messages", Locale.forLanguageTag("en"),
                new UTF8Control());
    }

    @AfterClass
    public static void tearDown() throws Exception {
        resourceBundle = null;
    }

    @Test
    public void getDecodedPasswordHello() {
        jiraConnector = new JiraConnector(resourceBundle);
        String decodedPassword = Deencapsulation.invoke(jiraConnector, "getDecodedPassword", "<PASSWORD>=");
        assertNotNull(decodedPassword);
        assertEquals("hello", decodedPassword);
    }

    @Test
    public void getDecodedPasswordGermanUber() {
        jiraConnector = new JiraConnector(resourceBundle);
        String decodedPassword = Deencapsulation.invoke(jiraConnector, "getDecodedPassword", "<PASSWORD>=");
        assertNotNull(decodedPassword);
        assertEquals("Über", decodedPassword);
    }

    @Test
    public void getJiraAddressUriEmpty() {
        jiraConnector = new JiraConnector(resourceBundle);
        URI uri = Deencapsulation.invoke(jiraConnector, "getJiraAddressUri", "");
        assertNull(uri);
    }

    @Test
    public void getJiraAddressUriKnownDns() {
        jiraConnector = new JiraConnector(resourceBundle);
        URI uri = Deencapsulation.invoke(jiraConnector, "getJiraAddressUri", "https:///google.com");
        assertNotNull(uri);
        assertEquals("https:///google.com", uri.toString());
    }

}
{'fraction_non_alphanumeric': 0.10058027079303675, 'fraction_numerical': 0.0009671179883945841, 'mean_word_length': 3.670428893905192, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7387709', 'n_tokens_mistral': 586, 'n_tokens_neox': 587, 'n_words': 116}