小编hel*_*ldt的帖子

在Jasmine 3中我应该使用什么而不是合适和fdescribe?

我收到错误:

ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'
Run Code Online (Sandbox Code Playgroud)

我为Jasmine 3.0做了一个RTFM,但没有提到任何关于弃用的内容:https://jasmine.github.io/api/3.0/global.html#fit

testing jasmine karma-runner angular

42
推荐指数
2
解决办法
6479
查看次数

Maven模块使用spring-boot

我喜欢通过创建模块来配置maven中的应用程序;

<groupId>com.app</groupId>
<artifactId>example-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
    <module>app-api</module>
    <module>app-impl</module>
    <module>app-web</module>
</modules>
Run Code Online (Sandbox Code Playgroud)

然后,模块使用'example-app'作为父级.

现在我想在我的Web应用程序中使用'spring-boot'.

有没有办法配置maven,以便我的'app-web'是一个spring-boot应用程序?

我面临的问题是你必须使用spring-boot作为父级.

java spring maven spring-boot

33
推荐指数
2
解决办法
2万
查看次数

使用spring security 3.1对使用活动目录进行身份验证时处理角色

我正在尝试使用Spring Security 3.1对Active Directory进行身份验证.我得到了认证,一切都很好.

<sec:ldap-server id="ldapServer" url="ldap://ldap/dc=sub,dc=domain,dc=com" port="389" />

<sec:authentication-manager erase-credentials="true"  >
    <sec:authentication-provider ref="ldapActiveDirectoryAuthProvider" />
</sec:authentication-manager>

<bean id="ldapActiveDirectoryAuthProvider" 
        class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
    <constructor-arg value="domain" />
    <constructor-arg value="ldap://server:389/"/> 
</bean>
Run Code Online (Sandbox Code Playgroud)

现在回答这个问题.如何处理用户角色以便我可以设置过滤器?

例如.

<sec:intercept-url pattern="/**" access="ROLE_USER"/>
Run Code Online (Sandbox Code Playgroud)

我通过使用UserDetailContextMapper并将我的AD组映射到ROLE_USER,ROLE_ADMIN等,找到了如何执行此操作的方法.

    <bean id="ldapActiveDirectoryAuthProvider" 
        class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
    <constructor-arg value="domain" />
    <constructor-arg value="ldap://host:389/"/> 
    <property name="userDetailsContextMapper" ref="tdrUserDetailsContextMapper"/>
    <property name="useAuthenticationRequestCredentials" value="true"/>
</bean>

<bean id="tdrUserDetailsContextMapper" class="com.bla.bla.UserDetailsContextMapperImpl"/>
Run Code Online (Sandbox Code Playgroud)

Mapper类:

public class UserDetailsContextMapperImpl implements UserDetailsContextMapper, Serializable{
    private static final long serialVersionUID = 3962976258168853954L;

    @Override
    public UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection<? extends GrantedAuthority> authority) {

        List<GrantedAuthority> mappedAuthorities = new …
Run Code Online (Sandbox Code Playgroud)

spring ldap active-directory spring-security

16
推荐指数
2
解决办法
2万
查看次数

angular 5.2 onSameUrlNavigation无法正常工作

我正试图在我的角度5.2应用程序中重新加载我的导航而没有任何成功.如果参数不变,角度路由器将忽略我的导航.

我如何导航:

this.router.navigate(['/search', buildParamsFromSearchCriteria(criteria)]);
Run Code Online (Sandbox Code Playgroud)

导航到:

/search;pageSize=20;page=1;orderBy=price;sortDirection=ASCENDING
Run Code Online (Sandbox Code Playgroud)

我的模块配置:

imports: [RouterModule.forRoot(appRoutes, { preloadingStrategy: PreloadAllModules, enableTracing: false, onSameUrlNavigation: 'reload' })],
Run Code Online (Sandbox Code Playgroud)

angular angular5

14
推荐指数
1
解决办法
4655
查看次数

变量对象的属性名称

在typescript中有一种方法可以从变量设置属性名称吗?

像这样的东西

export function objectFactory(prop: string) {
    return {
        prop: {
            valid: false
        }
    };
}
Run Code Online (Sandbox Code Playgroud)

typescript

10
推荐指数
1
解决办法
5235
查看次数

排除 Sonarqube 中的方法

使用 sonarqube 进行分析时,有没有办法排除类中的特定方法?我找到的只是如何排除文件和模块。

sonarqube sonarqube-web

6
推荐指数
1
解决办法
1万
查看次数

在 npm 脚本中将 shell 环境变量作为参数传递

我试图将环境变量作为参数传递给 npm 脚本,但没有成功。

export ENVIRONMENT=test.proxy.json
npm run test
Run Code Online (Sandbox Code Playgroud)

我正在尝试在 package.json 中做这样的事情

npm run test --proxy-config-file $ENVIRONMENT
Run Code Online (Sandbox Code Playgroud)

node.js npm

6
推荐指数
1
解决办法
8097
查看次数

在spring-hibernate-maven项目中出错

我尝试运行项目时收到"class file functionContext not found"错误.它运行没有错误,但在我写了一些单元测试并删除它后它开始给出这个错误.这是错误堆栈跟踪;

编译错误:

Failure executing javac, but could not parse the error:


An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.jaxen.FunctionContext not found
    at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
    at com.sun.tools.javac.main.Main.compile(Main.java:439)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.main.Main.compile(Main.java:342)
    at com.sun.tools.javac.main.Main.compile(Main.java:333)
    at com.sun.tools.javac.Main.compile(Main.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:554)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:161)
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:605)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128) …
Run Code Online (Sandbox Code Playgroud)

spring annotations hibernate maven

5
推荐指数
3
解决办法
1万
查看次数

angular2应用程序中的Karma测试异常

我可以获得更好的日志吗?我不知道在哪里寻找错误.

Chrome 57.0.2987 (Linux 0.0.0) ERROR
  Uncaught Response with status: 0  for URL: null
  at webpack:///~/rxjs/Subscriber.js:238:0 <- src/test.ts:737
PhantomJS 2.1.1 (Linux 0.0.0): Executed 31 of 31 ERROR (1.258 secs / 1.352 secs)
Run Code Online (Sandbox Code Playgroud)

karma-jasmine angular

5
推荐指数
1
解决办法
300
查看次数

Web 客户端在未找到响应时返回 Optional.empty()

当我从服务器收到 404(未找到)时,我试图WebClient返回一个Optional.empty()。但相反,我得到了一个 OptionalUser对象,所有属性都设置为 null。

我错过了什么?

@Override
public Optional<User> getUser(Username username) {
    return webClient
            .get()
            .uri(buildUrl(username))
            .retrieve()
            .onStatus(HttpStatus.NOT_FOUND::equals, response -> Mono.empty())
            .onStatus(HttpStatus::is4xxClientError, response -> createError(response, CLIENTERROR))
            .onStatus(HttpStatus::is5xxServerError, response -> createError(response, SERVRERROR))
            .bodyToMono(User.class)
            .blockOptional();
}
Run Code Online (Sandbox Code Playgroud)

java spring-webclient

3
推荐指数
1
解决办法
1454
查看次数