#380 - Renamed *Tests classes to *Test to make sure the Maven build runs them.

This commit is contained in:
Oliver Gierke
2015-09-02 08:28:05 +02:00
parent b41402f195
commit 9d35670e77
8 changed files with 7 additions and 72 deletions

View File

@@ -37,7 +37,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
*
* @author Oliver Gierke
*/
public class JacksonSerializationTests {
public class JacksonSerializationTest {
ObjectMapper mapper;

View File

@@ -29,7 +29,7 @@ import org.junit.Test;
* @author Oliver Gierke
* @soundtrack Dave Matthews Band - The Stone (Before These Crowded Streets)
*/
public class HopUnitTests {
public class HopUnitTest {
/**
* @see #346

View File

@@ -55,7 +55,7 @@ import org.springframework.web.client.RestTemplate;
* @author Greg Turnquist
* @since 0.11
*/
public class TraversonTests {
public class TraversonTest {
URI baseUri;
Server server;

View File

@@ -30,7 +30,7 @@ import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType
*
* @author Oliver Gierke
*/
public class XmlConfigurationIntegrationTests {
public class XmlConfigurationIntegrationTest {
/**
* @see #259

View File

@@ -28,7 +28,7 @@ import org.junit.Test;
*
* @author Oliver Gierke
*/
public class EmbeddedWrappersUnitTests {
public class EmbeddedWrappersUnitTest {
EmbeddedWrappers wrappers = new EmbeddedWrappers(false);

View File

@@ -1,65 +0,0 @@
/*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.hateoas.core;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.lang.reflect.Method;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.MethodParameter;
/**
* Unit tests for {@link MethodParameters}.
*
* @author Oliver Gierke
*/
public class MethodParametersUnitTests {
@Test
public void prefersAnnotatedParameterOverDiscovered() throws Exception {
Method method = Sample.class.getMethod("method", String.class, String.class, Object.class);
MethodParameters parameters = new MethodParameters(method, new AnnotationAttribute(Qualifier.class));
assertThat(parameters.getParameter("param"), is(notNullValue()));
assertThat(parameters.getParameter("foo"), is(notNullValue()));
assertThat(parameters.getParameter("another"), is(nullValue()));
}
/**
* @see #138
*/
@Test
public void returnsParametersOfAGivenType() throws Exception {
Method method = Sample.class.getMethod("method", String.class, String.class, Object.class);
MethodParameters methodParameters = new MethodParameters(method);
List<MethodParameter> objectParameters = methodParameters.getParametersOfType(Object.class);
assertThat(objectParameters, hasSize(1));
assertThat(objectParameters.get(0).getParameterIndex(), is(2));
}
static class Sample {
public void method(String param, @Qualifier("foo") String another, Object object) {}
}
}

View File

@@ -50,7 +50,7 @@ import org.springframework.web.client.RestTemplate;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class TypeReferencesIntegrationTests {
public class TypeReferencesIntegrationTest {
private static final String USER = "\"firstname\" : \"Dave\", \"lastname\" : \"Matthews\"";
private static final String RESOURCE = String.format("{ \"_links\" : { \"self\" : \"/resource\" }, %s }", USER);

View File

@@ -7,6 +7,6 @@
<context:annotation-config />
<bean class="org.springframework.hateoas.config.XmlConfigurationIntegrationTests$HypermediaConfiguration" />
<bean class="org.springframework.hateoas.config.XmlConfigurationIntegrationTest$HypermediaConfiguration" />
</beans>