我正在寻找将嵌入式弹性搜索添加到我的春季启动集成测试的方法.
我看了弹性搜索集成测试,但它不能与spring boot一起使用,因为两者都应该使用不同的测试运行器.
我有一个类测试,不幸的是它不能用于错误:
java.lang.IllegalStateException:没有线程的上下文信息:Thread [id = 1,name = main,state = RUNNABLE,group = main].该线程是否在com.carrotsearch.randomizedtesting.RandomizedRunner类的运行上下文中运行?将@RunWith(类com.carrotsearch.randomizedtesting.RandomizedRunner.class)添加到测试类.确保您的代码访问@BeforeClass和@AfterClass边界内的随机上下文(例如,不允许静态测试类初始值设定项访问随机上下文).
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = App.class)
@WebAppConfiguration
@IntegrationTest("server.port:0")
public class TestExample extends ElasticsearchIntegrationTest {
TestRestTemplate testRestTemplate = new TestRestTemplate();
@Value("${local.server.port}")
int port;
@Test
public void testOne(){
ResponseEntity<String> results = testRestTemplate.getForEntity(String.format("http://localhost:%d/client/1", port), String.class);
System.out.print(results);
}
}
Run Code Online (Sandbox Code Playgroud)
有没有人有一些想法如何使它们运行或什么是替代?
我正在写web base项目,我正在使用angularjs.我发现在选择html元素上使用ng:disabled指令的小错误.如果元素被禁用,我仍然可以使用向下和向上的键盘箭头更改其值.所以我想实现禁用select元素并消除这个小东西.
有人可以解释这个指令是如何工作的 我看过angularjs但无法弄明白.
这是一个错误或正常的行为,我无法理解的东西?
谢谢你提前回答.
示例:http: //jsfiddle.net/kickwce/m23Gr/1/
<select class="select input-large" id="listType" name="listType"
ng-model="listType" ng-disabled="listType">
<option value="">- choose -</option>
<option value="item1">List of tracks</option>
<option value="item2">List of collections</option>
</select>
Run Code Online (Sandbox Code Playgroud)