org.assertj.core.api.IterableAssert.isNotEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.assertj.core.api.IterableAssert.isNotEmpty()方法的一些代码示例,展示了IterableAssert.isNotEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IterableAssert.isNotEmpty()方法的具体详情如下:
包路径:org.assertj.core.api.IterableAssert
类名称:IterableAssert
方法名:isNotEmpty

IterableAssert.isNotEmpty介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

public static void verifyMinimumMigrationNumber(DbVersion underTest, int minimumMigrationNumber) {
 TestMigrationStepRegistry registry = new TestMigrationStepRegistry() {
  @Override
  public <T extends MigrationStep> MigrationStepRegistry add(long migrationNumber, String description, Class<T> stepClass) {
   super.add(migrationNumber, description, MigrationStep.class);
   assertThat(migrationNumber).isGreaterThanOrEqualTo(minimumMigrationNumber);
   return this;
  }
 };
 underTest.addSteps(registry);
 assertThat(registry.migrationNumbers).describedAs("No migration added to registry").isNotEmpty();
 assertThat(registry.migrationNumbers.stream().sorted().findFirst().get()).isEqualTo(minimumMigrationNumber);
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeValue_resultJsonHasValue() throws IOException {
 //given
 categoryGraphics.setValue(new Integer[] {new Integer(1), new Integer(2)});
 //when
 JsonNode actualObj = helper.serializeObject(categoryGraphics);
 //then
 Assertions.assertThat(actualObj.has("value")).isTrue();
 ArrayNode arrayNode = (ArrayNode) actualObj.get("value");
 Assertions.assertThat(arrayNode).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeColors_resultJsonHasColors() throws IOException {
 //given
 categoryGraphics.setColor(Arrays.asList(Color.BLACK, Color.BLUE));
 //when
 JsonNode actualObj = helper.serializeObject(categoryGraphics);
 //then
 Assertions.assertThat(actualObj.has("colors")).isTrue();
 ArrayNode arrayNode = (ArrayNode) actualObj.get("colors");
 Assertions.assertThat(arrayNode).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeColorsOfHistogram_resultJsonHasColors() throws IOException {
 //when
 histogram.setColor(Arrays.asList(Color.GREEN, Color.BLUE));
 histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("colors")).isTrue();
 Assertions.assertThat(actualObj.get("colors")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeDataListOfHistogram_resultJsonHasGraphicsList() throws IOException {
 //when
 histogram.setData(Arrays.asList(1, 2));
 histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("graphics_list")).isTrue();
 Assertions.assertThat(actualObj.get("graphics_list")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeXOfXYGraphicsLine_resultJsonHasX() throws IOException {
 //when
 line.setX(Arrays.asList(1, 2, 3));
 xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("x")).isTrue();
 Assertions.assertThat(actualObj.get("x")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeYOfXYGraphicsLine_resultJsonHasY() throws IOException {
 //when
 line.setY(Arrays.asList(1, 2, 3));
 xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("y")).isTrue();
 Assertions.assertThat(actualObj.get("y")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeXConstantBand_resultJsonHasX() throws IOException {
 //when
 ConstantBand constantBand = new ConstantBand();
 constantBand.setX(Arrays.asList(1, 2, 3));
 constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("x")).isTrue();
 Assertions.assertThat(actualObj.get("x")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeColorsPoints_resultJsonHasColors() throws IOException {
 //when
 points.setColor(Arrays.asList(Color.GREEN, Color.BLUE));
 pointsSerializer.serialize(points, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("colors")).isTrue();
 ArrayNode arrayNode = (ArrayNode) actualObj.get("colors");
 Assertions.assertThat(arrayNode.get(1)).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeYConstantBand_resultJsonHasY() throws IOException {
 //when
 ConstantBand constantBand = new ConstantBand();
 constantBand.setY(Arrays.asList(1, 2, 3));
 constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("y")).isTrue();
 Assertions.assertThat(actualObj.get("y")).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void serializeTextsOfXYChartPlot_resultJsonHasTexts() throws IOException {
 //given
 plot.add(new Text());
 //when
 xyChartSerializer.serialize(plot, jgen, new DefaultSerializerProvider.Impl());
 jgen.flush();
 //then
 JsonNode actualObj = mapper.readTree(sw.toString());
 Assertions.assertThat(actualObj.has("texts")).isTrue();
 Assertions.assertThat(actualObj.get("texts")).isNotEmpty();
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void realExamples() {
 File testFile = DuplicationsTestUtil.findFile("/java/MessageResources.java");
 assertThat(chunk(testFile)).isNotEmpty();
 testFile = DuplicationsTestUtil.findFile("/java/RequestUtils.java");
 assertThat(chunk(testFile)).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void createAreaByEmptyConstructor_hasPossibleFiltersIsNotEmpty(){
 //when
 Area area = new Area();
 //when
 Assertions.assertThat(area.getPossibleFilters()).isNotEmpty();
}

代码示例来源:origin: spring-projects/spring-security

@Test
public void validateWhenJwtHasNoIssuerThenReturnsError() {
  Jwt jwt = new Jwt(
      MOCK_TOKEN,
      MOCK_ISSUED_AT,
      MOCK_EXPIRES_AT,
      MOCK_HEADERS,
      Collections.singletonMap(JwtClaimNames.AUD, "https://aud"));
  OAuth2TokenValidatorResult result = this.validator.validate(jwt);
  assertThat(result.getErrors()).isNotEmpty();
}

代码示例来源:origin: spring-projects/spring-security

@Test
public void validateWhenIssuerMismatchesThenReturnsError() {
  Jwt jwt = new Jwt(
      MOCK_TOKEN,
      MOCK_ISSUED_AT,
      MOCK_EXPIRES_AT,
      MOCK_HEADERS,
      Collections.singletonMap(JwtClaimNames.ISS, "https://other"));
  OAuth2TokenValidatorResult result = this.validator.validate(jwt);
  assertThat(result.getErrors()).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void createPointsByEmptyConstructor_hasPossibleFiltersIsNotEmpty(){
 //when
 Points points = new Points();
 //when
 Assertions.assertThat(points.getPossibleFilters()).isNotEmpty();
}

代码示例来源:origin: twosigma/beakerx

@Test
public void createStemsByEmptyConstructor_hasPossibleFiltersIsNotEmpty(){
 //when
 Stems stems = new Stems();
 //when
 Assertions.assertThat(stems.getPossibleFilters()).isNotEmpty();
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void define_xoo_hotspot_rule() {
 RulesDefinition.Repository repo = context.repository("xoo");
 assertThat(repo).isNotNull();
 assertThat(repo.name()).isEqualTo("Xoo");
 assertThat(repo.language()).isEqualTo("xoo");
 assertThat(repo.rules()).hasSize(19);
 RulesDefinition.Rule rule = repo.rule(HotspotSensor.RULE_KEY);
 assertThat(rule.name()).isNotEmpty();
 assertThat(rule.securityStandards())
  .isNotEmpty()
  .containsExactlyInAnyOrder("cwe:1", "cwe:123", "cwe:863", "owaspTop10:a1", "owaspTop10:a3");
}

代码示例来源:origin: twosigma/beakerx

@Test
public void stdErrorHandlerWrite_addConsoleOutput() throws Exception {
 //given
 BeakerOutputHandler handler = seo.getStdErrorHandler();
 //when
 handler.write("test");
 //then
 Assertions.assertThat(seo.getConsoleOutput()).isNotEmpty();
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void create_index() {
 IndexCreator underTest = startNewCreator(new FakeIndexDefinition());
 // check that index is created with related mapping
 verifyFakeIndex();
 // of course do not delete indices on stop
 underTest.stop();
 assertThat(mappings()).isNotEmpty();
}

相关文章

微信公众号

最新文章

更多