Search in sources :

Example 6 with NameValuePair

use of org.apache.hc.core5.http.copied.NameValuePair in project httpcomponents-core by apache.

the class TestNameValuePair method testNullValue2NotEqual.

@Test
public void testNullValue2NotEqual() throws Exception {
    final NameValuePair NameValuePair = new BasicNameValuePair("name", "value");
    final NameValuePair NameValuePair2 = new BasicNameValuePair("name", null);
    Assertions.assertNotEquals(NameValuePair, NameValuePair2);
}
Also used : NameValuePair(org.apache.hc.core5.http.NameValuePair) Test(org.junit.jupiter.api.Test)

Example 7 with NameValuePair

use of org.apache.hc.core5.http.copied.NameValuePair in project httpcomponents-core by apache.

the class TestNameValuePair method testObjectNotEqual.

@Test
public void testObjectNotEqual() throws Exception {
    final NameValuePair NameValuePair = new BasicNameValuePair("name", "value");
    Assertions.assertNotEquals(NameValuePair, new Object());
}
Also used : NameValuePair(org.apache.hc.core5.http.NameValuePair) Test(org.junit.jupiter.api.Test)

Example 8 with NameValuePair

use of org.apache.hc.core5.http.copied.NameValuePair in project httpcomponents-core by apache.

the class TestNameValuePair method testHashCode.

@Test
public void testHashCode() throws Exception {
    final NameValuePair NameValuePair = new BasicNameValuePair("name", null);
    final NameValuePair NameValuePair2 = new BasicNameValuePair("name2", null);
    Assertions.assertNotEquals(NameValuePair.hashCode(), NameValuePair2.hashCode());
    final NameValuePair NameValuePair3 = new BasicNameValuePair("name", "value");
    final NameValuePair NameValuePair4 = new BasicNameValuePair("name", "value2");
    Assertions.assertNotEquals(NameValuePair3.hashCode(), NameValuePair4.hashCode());
    final NameValuePair NameValuePair5 = new BasicNameValuePair("name", "value");
    final NameValuePair NameValuePair6 = new BasicNameValuePair("name", null);
    Assertions.assertNotEquals(NameValuePair5.hashCode(), NameValuePair6.hashCode());
}
Also used : NameValuePair(org.apache.hc.core5.http.NameValuePair) Test(org.junit.jupiter.api.Test)

Example 9 with NameValuePair

use of org.apache.hc.core5.http.copied.NameValuePair in project httpcomponents-core by apache.

the class TestNameValuePair method testValueEquals.

@Test
public void testValueEquals() throws Exception {
    final NameValuePair NameValuePair = new BasicNameValuePair("name", "value");
    final NameValuePair NameValuePair2 = new BasicNameValuePair("name", "value");
    Assertions.assertEquals(NameValuePair, NameValuePair2);
    Assertions.assertEquals(NameValuePair.hashCode(), NameValuePair2.hashCode());
}
Also used : NameValuePair(org.apache.hc.core5.http.NameValuePair) Test(org.junit.jupiter.api.Test)

Example 10 with NameValuePair

use of org.apache.hc.core5.http.copied.NameValuePair in project httpcomponents-core by apache.

the class TestNameValuePair method testEquals.

@Test
public void testEquals() throws Exception {
    final NameValuePair NameValuePair = new BasicNameValuePair("name", "value");
    final NameValuePair NameValuePair2 = new BasicNameValuePair("name", "value");
    Assertions.assertEquals(NameValuePair, NameValuePair);
    Assertions.assertEquals(NameValuePair.hashCode(), NameValuePair.hashCode());
    Assertions.assertEquals(NameValuePair2, NameValuePair2);
    Assertions.assertEquals(NameValuePair2.hashCode(), NameValuePair2.hashCode());
    Assertions.assertEquals(NameValuePair, NameValuePair2);
    Assertions.assertEquals(NameValuePair.hashCode(), NameValuePair2.hashCode());
}
Also used : NameValuePair(org.apache.hc.core5.http.NameValuePair) Test(org.junit.jupiter.api.Test)

Aggregations

NameValuePair (org.apache.hc.core5.http.NameValuePair)56 Test (org.junit.jupiter.api.Test)26 BasicNameValuePair (org.apache.hc.core5.http.message.BasicNameValuePair)25 ArrayList (java.util.ArrayList)15 URI (java.net.URI)13 UrlEncodedFormEntity (org.apache.hc.client5.http.entity.UrlEncodedFormEntity)12 HttpPost (org.apache.hc.client5.http.classic.methods.HttpPost)11 Map (java.util.Map)10 CharArrayBuffer (org.apache.hc.core5.util.CharArrayBuffer)9 IOException (java.io.IOException)7 CloseableHttpResponse (org.apache.hc.client5.http.impl.classic.CloseableHttpResponse)7 URIBuilder (org.apache.hc.core5.net.URIBuilder)7 URISyntaxException (java.net.URISyntaxException)6 HashMap (java.util.HashMap)5 HeaderElement (org.apache.hc.core5.http.HeaderElement)5 HttpGet (org.apache.hc.client5.http.classic.methods.HttpGet)4 BasicHeader (org.apache.hc.core5.http.message.BasicHeader)4 List (java.util.List)3 CloseableHttpClient (org.apache.hc.client5.http.impl.classic.CloseableHttpClient)3 HttpEntity (org.apache.hc.core5.http.HttpEntity)3