我正在使用WebStorm 2017.2.4和webpack Vue.js项目.我已将bootstrap-vue.js添加到我的项目中,并希望看到它的提示和组件支持.
但我没有得到"未知的HTML标签"警告.
BTW:bootstrap-vue在运行项目时按预期工作.
您对如何使其有效有任何建议吗?
我想从标准输入异步读取用户产生的消息。就像是:
Flux.from(stdinPublisher())
.subscribe(msg -> System.out.println("Received: " + msg));
Run Code Online (Sandbox Code Playgroud)
那么如何在这里实现这样的stdin发布者呢?
我正在使用带有默认application.yml属性文件的Spring Boot 2.0 。我想将它拆分为单独的属性文件,因为它变得很大。
此外,我想编写测试来检查属性的正确性:将出现在生产应用程序上下文(而不是测试上下文)中的值。
这是我的属性文件:src/main/resources/config/custom.yml
my-property:
value: 'test'
Run Code Online (Sandbox Code Playgroud)
属性类:
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Data
@Configuration
@ConfigurationProperties(prefix = "my-property")
@PropertySource("classpath:config/custom.yml")
public class MyProperty {
private String value;
}
Run Code Online (Sandbox Code Playgroud)
测试:
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MyProperty.class)
@EnableConfigurationProperties
public class MyPropertyTest {
@Autowired
private MyProperty property;
@Test
public void test() {
assertEquals("test", property.getValue());
}
}
Run Code Online (Sandbox Code Playgroud)
但测试失败并出现错误:
java.lang.AssertionError:
Expected :test
Actual :null
Run Code Online (Sandbox Code Playgroud)
我还看到属性值是 …
我正在将 Spring boot 2 webflux 与反应式 mongo 存储库一起使用。我正在尝试使用Class<>字段类型持久化和查询实体。但我不知道如何配置我的应用程序以使用这种类型。这是我想存储在 mongo 中的实体:
import lombok.Data;
import org.springframework.data.annotation.Id;
@Data
public class ServiceEntity {
@Id
private String id;
private String name;
private Class inputClass;
}
Run Code Online (Sandbox Code Playgroud)
这是我的 mongo 配置:
import static java.util.Arrays.asList;
import com.mongodb.MongoClient;
import com.mongodb.MongoException;
import com.mongodb.async.client.MongoClientSettings;
import lombok.extern.slf4j.Slf4j;
import org.bson.BsonReader;
import org.bson.BsonWriter;
import org.bson.codecs.Codec;
import org.bson.codecs.DecoderContext;
import org.bson.codecs.EncoderContext;
import org.bson.codecs.configuration.CodecProvider;
import org.bson.codecs.configuration.CodecRegistries;
import org.bson.codecs.configuration.CodecRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
@Configuration
@Slf4j
public class MongoConfiguration {
@Bean
public MongoClientSettings settings() …Run Code Online (Sandbox Code Playgroud)