本文整理了Java中org.assertj.core.api.IterableAssert.isEqualTo()
方法的一些代码示例,展示了IterableAssert.isEqualTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IterableAssert.isEqualTo()
方法的具体详情如下:
包路径:org.assertj.core.api.IterableAssert
类名称:IterableAssert
方法名:isEqualTo
暂无
代码示例来源:origin: SonarSource/sonarqube
@Test
public void index_with_valueFunction_parallel_stream() {
Multimap<String, String> multimap = HUGE_LIST.parallelStream().collect(index(identity(), identity()));
assertThat(multimap.keySet()).isEqualTo(HUGE_SET);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void uniqueIndex_with_valueFunction_and_expected_size_parallel_stream() {
Map<String, String> map = HUGE_LIST.parallelStream().collect(uniqueIndex(identity(), identity(), HUGE_LIST.size()));
assertThat(map.keySet()).isEqualTo(HUGE_SET);
assertThat(map.values()).containsExactlyElementsOf(HUGE_SET);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void uniqueIndex_with_expected_size_parallel_stream() {
Map<String, String> map = HUGE_LIST.parallelStream().collect(uniqueIndex(identity(), HUGE_LIST.size()));
assertThat(map.keySet()).isEqualTo(HUGE_SET);
assertThat(map.values()).containsExactlyElementsOf(HUGE_SET);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void uniqueIndex_with_valueFunction_parallel_stream() {
Map<String, String> map = HUGE_LIST.parallelStream().collect(uniqueIndex(identity(), identity()));
assertThat(map.keySet()).isEqualTo(HUGE_SET);
assertThat(map.values()).containsExactlyElementsOf(HUGE_SET);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void CeWorkerFactory_must_returns_the_workers_returned_by_created() {
Set<CeWorker> expected = new HashSet<>();
for (int i = 0; i < 1 + new Random().nextInt(10); i++) {
expected.add(underTest.create(i));
}
assertThat(underTest.getWorkers()).isEqualTo(expected);
}
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void deserializeAuthenticatedUsernamePasswordAuthenticationTokenMixinTest() throws IOException {
UsernamePasswordAuthenticationToken expectedToken = createToken();
UsernamePasswordAuthenticationToken token = mapper
.readValue(AUTHENTICATED_STRINGPRINCIPAL_JSON, UsernamePasswordAuthenticationToken.class);
assertThat(token).isNotNull();
assertThat(token.isAuthenticated()).isTrue();
assertThat(token.getAuthorities()).isEqualTo(expectedToken.getAuthorities());
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void verify_getters() {
List<QualityGate.Condition> conditions = ImmutableList.of(condition);
QualityGateImpl underTest = new QualityGateImpl(SOME_ID, SOME_NAME, SOME_STATUS, conditions);
assertThat(underTest.getId()).isEqualTo(SOME_ID);
assertThat(underTest.getName()).isEqualTo(SOME_NAME);
assertThat(underTest.getStatus()).isEqualTo(SOME_STATUS);
assertThat(underTest.getConditions()).isEqualTo(conditions);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void methodsWithDifferentArgumentsAreMatchedCorrectly() throws Exception {
mds.addSecureMethod(MockService.class, someMethodInteger, ROLE_A);
mds.addSecureMethod(MockService.class, someMethodString, ROLE_B);
assertThat(mds.getAttributes(someMethodInteger, MockService.class)).isEqualTo(ROLE_A);
assertThat(mds.getAttributes(someMethodString, MockService.class)).isEqualTo(ROLE_B);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void checkCluster_returns_NodeHealths_returned_by_HealthState() {
when(webServer.isStandalone()).thenReturn(false);
Set<NodeHealth> nodeHealths = IntStream.range(0, 1 + random.nextInt(4)).mapToObj(i -> randomNodeHealth()).collect(Collectors.toSet());
when(sharedHealthState.readAll()).thenReturn(nodeHealths);
HealthCheckerImpl underTest = new HealthCheckerImpl(webServer, new NodeHealthCheck[0], new ClusterHealthCheck[0], sharedHealthState);
ClusterHealth clusterHealth = underTest.checkCluster();
assertThat(clusterHealth.getNodes()).isEqualTo(nodeHealths);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void constructorWhenAllParametersProvidedAndValidThenCreated() {
OAuth2AuthenticationToken authentication = new OAuth2AuthenticationToken(
this.principal, this.authorities, this.authorizedClientRegistrationId);
assertThat(authentication.getPrincipal()).isEqualTo(this.principal);
assertThat(authentication.getCredentials()).isEqualTo("");
assertThat(authentication.getAuthorities()).isEqualTo(this.authorities);
assertThat(authentication.getAuthorizedClientRegistrationId()).isEqualTo(this.authorizedClientRegistrationId);
assertThat(authentication.isAuthenticated()).isEqualTo(true);
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void test_getters() {
DefaultTrackingInput underTest = new DefaultTrackingInput(issues, lineHashes, blockHashes);
assertThat(underTest.getBlockHashSequence()).isEqualTo(blockHashes);
assertThat(underTest.getLineHashSequence()).isEqualTo(lineHashes);
assertThat(underTest.getIssues()).isEqualTo(issues);
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
@UseDataProvider("coreExtensionsSets")
public void loadedCoreExtensions_returns_CoreExtensions_from_setLoadedCoreExtensions(Set<CoreExtension> coreExtensions) {
underTest.setLoadedCoreExtensions(coreExtensions);
assertThat(underTest.loadedCoreExtensions().collect(Collectors.toSet()))
.isEqualTo(coreExtensions);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void constructorAuthorizationRequestResponseWhenAllParametersProvidedAndValidThenCreated() {
OAuth2LoginAuthenticationToken authentication = new OAuth2LoginAuthenticationToken(
this.clientRegistration, this.authorizationExchange);
assertThat(authentication.getPrincipal()).isNull();
assertThat(authentication.getCredentials()).isEqualTo("");
assertThat(authentication.getAuthorities()).isEqualTo(Collections.emptyList());
assertThat(authentication.getClientRegistration()).isEqualTo(this.clientRegistration);
assertThat(authentication.getAuthorizationExchange()).isEqualTo(this.authorizationExchange);
assertThat(authentication.getAccessToken()).isNull();
assertThat(authentication.isAuthenticated()).isEqualTo(false);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void constructorAuthorizationRequestResponseWhenAllParametersProvidedAndValidThenCreated() {
OAuth2AuthorizationCodeAuthenticationToken authentication =
new OAuth2AuthorizationCodeAuthenticationToken(this.clientRegistration, this.authorizationExchange);
assertThat(authentication.getPrincipal()).isEqualTo(this.clientRegistration.getClientId());
assertThat(authentication.getCredentials()).isEqualTo(this.authorizationExchange.getAuthorizationResponse().getCode());
assertThat(authentication.getAuthorities()).isEqualTo(Collections.emptyList());
assertThat(authentication.getClientRegistration()).isEqualTo(this.clientRegistration);
assertThat(authentication.getAuthorizationExchange()).isEqualTo(this.authorizationExchange);
assertThat(authentication.getAccessToken()).isNull();
assertThat(authentication.isAuthenticated()).isEqualTo(false);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void constructorWhenAllParametersProvidedAndValidThenCreated() {
OAuth2AccessToken accessToken = new OAuth2AccessToken(
TOKEN_TYPE, TOKEN_VALUE, ISSUED_AT, EXPIRES_AT, SCOPES);
assertThat(accessToken.getTokenType()).isEqualTo(TOKEN_TYPE);
assertThat(accessToken.getTokenValue()).isEqualTo(TOKEN_VALUE);
assertThat(accessToken.getIssuedAt()).isEqualTo(ISSUED_AT);
assertThat(accessToken.getExpiresAt()).isEqualTo(EXPIRES_AT);
assertThat(accessToken.getScopes()).isEqualTo(SCOPES);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void withUserDetailsWhenAllDisabled() throws Exception {
User expected = new User("rob", "pass", false, false, false, false, ROLE_12);
UserDetails actual = User.withUserDetails(expected).build();
assertThat(actual.getUsername()).isEqualTo(expected.getUsername());
assertThat(actual.getPassword()).isEqualTo(expected.getPassword());
assertThat(actual.getAuthorities()).isEqualTo(expected.getAuthorities());
assertThat(actual.isAccountNonExpired()).isEqualTo(expected.isAccountNonExpired());
assertThat(actual.isAccountNonLocked()).isEqualTo(expected.isAccountNonLocked());
assertThat(actual.isCredentialsNonExpired()).isEqualTo(expected.isCredentialsNonExpired());
assertThat(actual.isEnabled()).isEqualTo(expected.isEnabled());
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void wildcardedMatchIsOverwrittenByMoreSpecificMatch() {
mds.addSecureMethod(MockService.class, "some*", ROLE_A);
mds.addSecureMethod(MockService.class, "someMethod*", ROLE_B);
assertThat(mds.getAttributes(someMethodInteger, MockService.class)).isEqualTo(ROLE_B);
}
代码示例来源:origin: spring-projects/spring-security
@Test
public void testOperation() {
List<ConfigAttribute> attr = SecurityConfig.createList("FOO");
MethodInvocation mi = new SimpleMethodInvocation();
SecurityContext ctx = SecurityContextHolder.createEmptyContext();
InterceptorStatusToken token = new InterceptorStatusToken(ctx, true, attr, mi);
assertThat(token.isContextHolderRefreshRequired()).isTrue();
assertThat(token.getAttributes()).isEqualTo(attr);
assertThat(token.getSecureObject()).isEqualTo(mi);
assertThat(token.getSecurityContext()).isSameAs(ctx);
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void verify_getters() {
Health health = randomHealth();
Set<NodeHealth> nodeHealths = randomNodeHealths();
ClusterHealth underTest = new ClusterHealth(health, nodeHealths);
assertThat(underTest.getHealth()).isSameAs(health);
assertThat(underTest.getNodes()).isEqualTo(nodeHealths);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
@UseDataProvider("portfolioOrApplicationRootViewQualifier")
public void selectViewKeysWithEnabledCopyOfProject_returns_root_view_with_direct_copy_of_project(String rootViewQualifier) {
OrganizationDto organization = db.organizations().insert();
ComponentDto project = insertProject(organization);
ComponentDto view = insertView(organization, rootViewQualifier);
insertProjectCopy(view, project);
Set<String> keys = underTest.selectViewKeysWithEnabledCopyOfProject(dbSession, singleton(project.uuid()));
assertThat(keys).containsOnly(view.getDbKey());
assertThat(underTest.selectViewKeysWithEnabledCopyOfProject(dbSession, shuffleWithNonExistentUuids(project.uuid())))
.isEqualTo(keys);
}
内容来源于网络,如有侵权,请联系作者删除!