package com.gentics.mesh.rest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.assertj.core.api.Assertions.*;
import java.util.Arrays;

import org.junit.Test;

import com.gentics.mesh.parameter.NodeParameters;
import com.gentics.mesh.rest.client.AbstractMeshRestHttpClient;
import com.gentics.mesh.rest.client.MeshRestClient;
import io.vertx.core.Vertx;

public class MeshRestClientTest {

	@Test
	public void testRestClient() {
		MeshRestClient client = MeshRestClient.create("localhost", 8080, Vertx.vertx());
		client.close();
	}

	@Test
	public void testParameterHandling() {
		NodeParameters parameters1 = mock(NodeParameters.class);
		when(parameters1.getLanguages()).thenReturn(new String[] { "en" });
		assertThat(parameters1.getLanguages()).contains("en");
		when(parameters1.getQueryParameters()).thenReturn("lang=en");
		assertEquals("?lang=en", AbstractMeshRestHttpClient.getQuery(parameters1));

		NodeParameters parameters2 = mock(NodeParameters.class);

		when(parameters2.getExpandedFieldNames()).thenReturn(new String[] { "test" });
		assertThat(parameters2.getExpandedFieldNames()).contains("test");

		when(parameters2.getQueryParameters()).thenReturn("expand=test");
		assertEquals("?lang=en&expand=test", AbstractMeshRestHttpClient.getQuery(parameters1, parameters2));

		assertEquals("", AbstractMeshRestHttpClient.getQuery());
	}
}

@@ -47,33 +47,46 @@
 org.
-junit
+assertj.core.api
 .Assert
+ions
 .assert
-Equals
+That
 ;%0Aim
@@ -116,28 +116,30 @@
 ssert.assert
-That
+Equals
 ;%0Aimport sta
@@ -211,82 +211,8 @@
 hen;
-%0Aimport static org.assertj.core.api.Assertions.*;%0Aimport java.util.Arrays;
 %0A%0Aim
@@ -343,24 +343,24 @@
 HttpClient;%0A
-
 import com.g
@@ -395,24 +395,25 @@
 RestClient;%0A
+%0A
 import io.ve

Remove bogus imports