Skip to content

Commit d5fff3a

Browse files
committed
NestedObject Tests
1 parent 17e80b9 commit d5fff3a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2013 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+
*/
16+
package org.springframework.data.elasticsearch.repositories;
17+
18+
import org.junit.Before;
19+
import org.junit.runner.RunWith;
20+
import org.springframework.beans.factory.annotation.Autowired;
21+
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
22+
import org.springframework.data.elasticsearch.entities.Person;
23+
import org.springframework.test.context.ContextConfiguration;
24+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
25+
26+
/**
27+
* @author Rizwan Idrees
28+
* @author Mohsin Husen
29+
* @author Artur Konczak
30+
*/
31+
@RunWith(SpringJUnit4ClassRunner.class)
32+
@ContextConfiguration("classpath:/springContext-test.xml")
33+
public class NestedObjectTests {
34+
35+
@Autowired
36+
private ElasticsearchTemplate elasticsearchTemplate;
37+
38+
39+
@Before
40+
public void before() {
41+
elasticsearchTemplate.deleteIndex(Person.class);
42+
elasticsearchTemplate.createIndex(Person.class);
43+
elasticsearchTemplate.putMapping(Person.class);
44+
elasticsearchTemplate.refresh(Person.class, true);
45+
}
46+
}

0 commit comments

Comments
 (0)