@Test public void createLineWithTwoNumberListParams_lineHasXsAndYsListsAreNotNulls() { //when Line line = new Line( Arrays.asList(new Integer(10), new Integer(20)), Arrays.asList(new Integer(30), new Integer(40))); //then Assertions.assertThat(line.getX()).isNotNull(); Assertions.assertThat(line.getY()).isNotNull(); }
@Test public void stageStart_shouldAddStageToTaskLists() throws Exception { //when service.stageStart(stageId, 1); //then Assertions.assertThat(getActiveTasks(service).get(stageId)).isNotNull(); Assertions.assertThat(getFailedTasks(service).get(stageId)).isNotNull(); Assertions.assertThat(getSucceededTasks(service).get(stageId)).isNotNull(); }
@Test public void shutdownNow() { List<Runnable> result = executor.shutdownNow(); verify(delegate).shutdownNow(); assertThat(result).isEqualTo(delegate.shutdownNow()).isNotNull(); }
@Test public void setXWithIntegerFloatDateListParam_hasXsListAreNotNulls() { //when constantBand.setX(Arrays.asList(new Integer(123), new Float(123.0), new Date())); //then Assertions.assertThat(constantBand.getX()).isNotNull(); }
@Test public void setSizeWithIntegerList_hasSizeListIsNotNull() { //when points.setSize(Arrays.asList(new Integer(10), new Integer(20))); //then Assertions.assertThat(points.getSizes()).isNotNull(); }
@Test public void setWidthWithIntegerList_hasWidthListIsNotNull() { //when bars.setWidth(Arrays.asList(new Integer(486), new Integer(528))); //then Assertions.assertThat(bars.getWidths()).isNotNull(); }
@Test public void testGetDn() throws Exception { assertThat(authority.getDn()).isEqualTo(DN); assertThat(authority.getAttributeValues(SpringSecurityLdapTemplate.DN_KEY)).isNotNull(); assertThat(authority.getAttributeValues(SpringSecurityLdapTemplate.DN_KEY)).hasSize(1); assertThat(authority.getFirstAttributeValue(SpringSecurityLdapTemplate.DN_KEY)).isEqualTo(DN); }
@Test public void populateContainer_adds_classes_of_all_steps_defined_in_MigrationSteps() { when(migrationSteps.readAll()).thenReturn(asList( new RegisteredMigrationStep(1, "foo", MigrationStep1.class), new RegisteredMigrationStep(2, "bar", MigrationStep2.class), new RegisteredMigrationStep(3, "dor", MigrationStep3.class))); underTest.populateContainer(migrationContainer); assertThat(migrationContainer.getComponentsByType(MigrationStep1.class)).isNotNull(); assertThat(migrationContainer.getComponentsByType(MigrationStep2.class)).isNotNull(); assertThat(migrationContainer.getComponentsByType(MigrationStep3.class)).isNotNull(); }
@Test public void testGetAttributes() throws Exception { assertThat(authority.getAttributes()).isNotNull(); assertThat(authority.getAttributeValues("mail")).isNotNull(); assertThat(authority.getAttributeValues("mail")).hasSize(2); assertThat(authority.getFirstAttributeValue("mail")).isEqualTo("filip@ldap.test.org"); assertThat(authority.getAttributeValues("mail").get(0)).isEqualTo("filip@ldap.test.org"); assertThat(authority.getAttributeValues("mail").get(1)).isEqualTo("filip@ldap.test2.org"); }
@Test public void deserialize_resultObjectHasValues() throws Exception { //given ObjectMapper mapper = new ObjectMapper(); JsonNode actualObj = mapper.readTree(json); CollectionDeserializer deserializer = new CollectionDeserializer(new BasicObjectSerializer()); //when List list = (List) deserializer.deserialize(actualObj, mapper); //then Assertions.assertThat(list).isNotNull(); Assertions.assertThat(list.size()).isEqualTo(3); }
@Test public void setOutlineColorWithList_hasOutlineColorListIsNotNull() { //when bars.setOutlineColor(Arrays.asList(Color.BLUE, Color.GREEN)); //then Assertions.assertThat(bars.getOutlineColors()).isNotNull(); }
@Test public void populateCotnainer_does_not_fail_if_same_class_is_used_for_more_than_one_migration() { when(migrationSteps.readAll()).thenReturn(asList( new RegisteredMigrationStep(1, "foo", MigrationStep1.class), new RegisteredMigrationStep(2, "bar", MigrationStep2.class), new RegisteredMigrationStep(3, "bar2", MigrationStep2.class), new RegisteredMigrationStep(4, "foo2", MigrationStep1.class), new RegisteredMigrationStep(5, "dor", MigrationStep3.class))); underTest.populateContainer(migrationContainer); assertThat(migrationContainer.getComponentsByType(MigrationStep1.class)).isNotNull(); assertThat(migrationContainer.getComponentsByType(MigrationStep2.class)).isNotNull(); assertThat(migrationContainer.getComponentsByType(MigrationStep3.class)).isNotNull(); }
@Test public void setStyleWithStrokeTypeListParam_hasStyleListIsNotNull() { //when stems.setStyle(Arrays.asList(StrokeType.values())); //then Assertions.assertThat(stems.getStyles()).isNotNull(); }
@Test public void setShapeWithShapeTypeListParam_hasShapeListIsNotNull() { //when points.setShape(Arrays.asList(ShapeType.values())); //then Assertions.assertThat(points.getShapes()).isNotNull(); }
@Test @SuppressWarnings("unchecked") public void addFilterAfterIsApplied(){ SecurityWebFilterChain securityWebFilterChain = this.http.addFilterAfter(new TestWebFilter(), SecurityWebFiltersOrder.SECURITY_CONTEXT_SERVER_WEB_EXCHANGE).build(); List filters = securityWebFilterChain.getWebFilters().map(WebFilter::getClass).collectList().block(); assertThat(filters).isNotNull() .isNotEmpty() .containsSequence(SecurityContextServerWebExchangeWebFilter.class, TestWebFilter.class); }
@Test @SuppressWarnings("unchecked") public void addFilterBeforeIsApplied(){ SecurityWebFilterChain securityWebFilterChain = this.http.addFilterBefore(new TestWebFilter(), SecurityWebFiltersOrder.SECURITY_CONTEXT_SERVER_WEB_EXCHANGE).build(); List filters = securityWebFilterChain.getWebFilters().map(WebFilter::getClass).collectList().block(); assertThat(filters).isNotNull() .isNotEmpty() .containsSequence(TestWebFilter.class, SecurityContextServerWebExchangeWebFilter.class); }
@Test public void select_snapshot_by_query() { db.prepareDbUnit(getClass(), "select_snapshots_by_query.xml"); assertThat(underTest.selectAnalysesByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("ABCD").setIsLast(true))).isNotNull(); assertThat(underTest.selectAnalysisByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("UNKOWN"))).isNull(); assertThat(underTest.selectAnalysisByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("GHIJ"))).isNull(); }