Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 3569255

Browse files
committed
Added SolrClientUtil tests.
1 parent bc5af67 commit 3569255

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/main/java/org/springframework/data/solr/core/MulticoreSolrOperations.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package org.springframework.data.solr.core;
217

318
import java.io.Serializable;

src/test/java/org/springframework/data/solr/server/support/SolrClientUtilTests.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
/**
4949
* @author Christoph Strobl
50+
* @author Venil Noronha
5051
*/
5152
public class SolrClientUtilTests {
5253

@@ -203,6 +204,21 @@ public void testResolveSolrCoreNameShouldReturnAnnotationValueWhenPresent() {
203204
Assert.assertThat(SolrClientUtils.resolveSolrCoreName(ClassWithSolrDocumentAnnotation.class), equalTo("core1"));
204205
}
205206

207+
@Test
208+
public void testResolveDefaultSolrCoreName() {
209+
Assert.assertEquals("default-core", SolrClientUtils.resolveSolrCoreName(ClassWithoutSolrDocumentAnnotation.class, "default-core"));
210+
}
211+
212+
@Test
213+
public void testResolveDefaultSolrCoreNameWithEmptyAnnotation() {
214+
Assert.assertEquals("default-core", SolrClientUtils.resolveSolrCoreName(ClassWithEmptySolrDocumentAnnotation.class, "default-core"));
215+
}
216+
217+
@Test
218+
public void testResolveDefaultSolrCoreNameWithAnnotation() {
219+
Assert.assertEquals("core1", SolrClientUtils.resolveSolrCoreName(ClassWithSolrDocumentAnnotation.class, "default-core"));
220+
}
221+
206222
/**
207223
* @see DATASOLR-189
208224
*/

0 commit comments

Comments
 (0)