我有一个包含超过一千件商品的下拉列表.点击clear按钮后,它应该清除所有项目.为了删除我尝试循环.
从下拉列表或列表框中删除所有项目的最快方法是什么?
我需要将我的支柱组织到子目录中.
/srv/pillar/
??? app1
? ??? env1
? ??? conf.sls
??? data.sls
??? top.sls
Run Code Online (Sandbox Code Playgroud)
我把它放在top.sls中:
base:
'*':
- data
- app1/env1/conf
Run Code Online (Sandbox Code Playgroud)
当我请求data.sls for variable时info,它可以工作:
salt '*' pillar.get info
local:
some data
Run Code Online (Sandbox Code Playgroud)
但是当我请求conf.sls变量时info,没有任何作用:
salt '*' pillar.get app1.env1.info
Run Code Online (Sandbox Code Playgroud)
没有显示!
我已经执行了:
saltutil.refresh_pillar
Run Code Online (Sandbox Code Playgroud)
并重新启动salt进程.
我该怎么做才能让盐柱识别子目录?
在尝试使用 JUnit 5 的参数化功能时,我偶然发现了一个初始化错误。
@ExtendWith(MockitoExtension.class)
@RunWith(Parameterized.class)
public class ServiceTest {
@InjectMocks
Service service;
private static Stream<Arguments> getArguments() {
return Stream.of(
Arguments.of("something", "result1", "result2"),
Arguments.of("another", "result3", "result4")
);
}
@ParameterizedTest
@MethodSource("getArguments")
@DisplayName("Test parseEndpoint method")
void testMethod(String arg1, String result1, String result2) {
final String[] strings = service.doSomething(arg1);
assertEquals(result1, strings[0]);
assertEquals(result2, strings[1]);
}
}
Run Code Online (Sandbox Code Playgroud)
然后我可以看到我的测试正在由参数化引擎和 JUnit Vintage 单元运行。这里的问题是如何禁用这样的类只由 Parameterized.class 运行?!
如何在 Word 文档中使用 Apache POI 将表格单元格的内容居中和加粗?这是我用来构建表的代码:
XWPFDocument document = new XWPFDocument();
XWPFTable table = document.createTable();
XWPFTableRow tableRowOne = table.getRow(0);
tableRowOne.getCell(0).setText("CUSTOMER_NAME");
tableRowOne.addNewTableCell().setText("Kumar");
tableRowOne.addNewTableCell().setText("CUSTOMER_ID");
tableRowOne.addNewTableCell().setText("123");
XWPFTableRow tableRowTwo = table.createRow();
tableRowTwo.getCell(0).setText("AGE_GENDER");
tableRowTwo.getCell(1).setText("25/M");
tableRowTwo.getCell(2).setText("VISIT_DATE");
tableRowTwo.getCell(3).setText("11/02/2021");
XWPFTableRow tableRowThree = table.createRow();
tableRowThree.getCell(0).setText("REFERRED_BY");
tableRowThree.getCell(1).setText("Self");
Run Code Online (Sandbox Code Playgroud) alignment ×1
apache-poi ×1
java ×1
javascript ×1
junit5 ×1
mockito ×1
ms-word ×1
salt-stack ×1