Polish AssertJ assertions
Polish AssertJ assertions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -299,7 +299,7 @@ public class MessageSecurityMetadataSourceRegistryTests {
|
||||
if (attrs == null) {
|
||||
return null;
|
||||
}
|
||||
assertThat(attrs.size()).isEqualTo(1);
|
||||
assertThat(attrs).hasSize(1);
|
||||
return attrs.iterator().next().toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -65,8 +65,7 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
|
||||
.getBean("fids");
|
||||
Collection<ConfigAttribute> cad = fids
|
||||
.getAttributes(createFilterInvocation("/anything", "GET"));
|
||||
assertThat(cad).isNotNull();
|
||||
assertThat(cad.contains(new SecurityConfig("ROLE_A"))).isTrue();
|
||||
assertThat(cad).contains(new SecurityConfig("ROLE_A"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -80,7 +79,7 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
|
||||
ConfigAttribute[] cad = fids
|
||||
.getAttributes(createFilterInvocation("/anything", "GET"))
|
||||
.toArray(new ConfigAttribute[0]);
|
||||
assertThat(cad.length).isEqualTo(1);
|
||||
assertThat(cad).hasSize(1);
|
||||
assertThat(cad[0].toString()).isEqualTo("hasRole('ROLE_A')");
|
||||
}
|
||||
|
||||
@@ -98,9 +97,7 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
|
||||
.getBean("fids");
|
||||
Collection<ConfigAttribute> cad = fids
|
||||
.getAttributes(createFilterInvocation("/secure", "GET"));
|
||||
assertThat(cad).isNotNull();
|
||||
assertThat(cad).hasSize(1);
|
||||
assertThat(cad.contains(new SecurityConfig("ROLE_A"))).isTrue();
|
||||
assertThat(cad).containsExactly(new SecurityConfig("ROLE_A"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -108,7 +108,7 @@ public class GlobalMethodSecurityBeanDefinitionParserTests {
|
||||
|
||||
// SEC-1213. Check the order
|
||||
Advisor[] advisors = ((Advised) target).getAdvisors();
|
||||
assertThat(advisors.length).isEqualTo(1);
|
||||
assertThat(advisors).hasSize(1);
|
||||
assertThat(((MethodSecurityMetadataSourceAdvisor) advisors[0]).getOrder()).isEqualTo(1001);
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class GlobalMethodSecurityBeanDefinitionParserTests {
|
||||
target = (BusinessService) appContext.getBean("target");
|
||||
Object[] arg = new String[] { "joe", "bob", "sam" };
|
||||
Object[] result = target.methodReturningAnArray(arg);
|
||||
assertThat(result.length).isEqualTo(1);
|
||||
assertThat(result).hasSize(1);
|
||||
assertThat(result[0]).isEqualTo("bob");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -66,11 +66,11 @@ public class InterceptMethodsBeanDefinitionDecoratorTests implements
|
||||
@Test
|
||||
public void targetDoesntLoseApplicationListenerInterface() {
|
||||
assertThat(appContext.getBeansOfType(ApplicationListener.class)).hasSize(1);
|
||||
assertThat(appContext.getBeanNamesForType(ApplicationListener.class).length).isEqualTo(1);
|
||||
assertThat(appContext.getBeanNamesForType(ApplicationListener.class)).hasSize(1);
|
||||
appContext.publishEvent(new AuthenticationSuccessEvent(
|
||||
new TestingAuthenticationToken("user", "")));
|
||||
|
||||
assertThat(target instanceof ApplicationListener<?>).isTrue();
|
||||
assertThat(target).isInstanceOf(ApplicationListener.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user