Refine search
@Test public void shouldReturnNonNullClaimWhenParsingArray() throws Exception { JsonNode value = mapper.valueToTree(new String[]{}); Claim claim = claimFromNode(value); assertThat(claim, is(notNullValue())); assertThat(claim, is(instanceOf(JsonNodeClaim.class))); assertThat(claim.isNull(), is(false)); }
@Test @TestForIssue(jiraKey = "HHH-11651") public void testUnwrappingAbstractMultiTenantConnectionProvider() { final MultiTenantConnectionProvider multiTenantConnectionProvider = serviceRegistry.getService( MultiTenantConnectionProvider.class ); final AbstractMultiTenantConnectionProvider connectionProvider = multiTenantConnectionProvider.unwrap( AbstractMultiTenantConnectionProvider.class ); assertThat( connectionProvider, is( notNullValue() ) ); }
@Test public void supportsMixedTypes() { final Matcher<SampleSubClass> matcher = allOf( equalTo(new SampleBaseClass("bad")), is(notNullValue()), equalTo(new SampleBaseClass("good")), equalTo(new SampleSubClass("ugly"))); assertDoesNotMatch("didn't fail last sub-matcher", matcher, new SampleSubClass("good")); }
@Test public void shouldCloseTransactionsWhenIteratingResults() { // Given an execution result that has been started but not exhausted createNode(); createNode(); Result executionResult = db.execute( "CYPHER runtime=interpreted MATCH (n) RETURN n" ); executionResult.next(); assertThat( activeTransaction(), is( notNullValue() ) ); // When executionResult.close(); // Then assertThat( activeTransaction(), is( nullValue() ) ); }
@Override public void execute(DelegateExecution execution) throws Exception { assertThat(execution.getVariableLocal("targetOrderId"),is(notNullValue())); } }
protected void assertArtifactIsNotRegisteredAsZombie(String artifactName, Map<String, Map<URI, Long>> zombieMap) { if (zombieMap.containsKey(artifactName)) { Map.Entry<URI, Long> zombieEntry = getZombieFromMap((entry) -> new File((URI) entry.getKey()).getName().equals(artifactName), zombieMap); assertThat("Artifact tagged as zombie.", zombieEntry, is(notNullValue())); } }
@Test public void shouldReturnNonNullClaimWhenParsingIntValue() throws Exception { JsonNode value = mapper.valueToTree(Integer.MAX_VALUE); Claim claim = claimFromNode(value); assertThat(claim, is(notNullValue())); assertThat(claim, is(instanceOf(JsonNodeClaim.class))); assertThat(claim.isNull(), is(false)); }
@Test @TestForIssue(jiraKey = "HHH-11651") public void testUnwrappingMultiTenantConnectionProvider() { final MultiTenantConnectionProvider multiTenantConnectionProvider = serviceRegistry.getService( MultiTenantConnectionProvider.class ); final MultiTenantConnectionProvider connectionProvider = multiTenantConnectionProvider.unwrap( MultiTenantConnectionProvider.class ); assertThat( connectionProvider, is( notNullValue() ) ); } }
@Test public void findDomainApplicationsWillNonExistentDomainReturnsEmptyCollection() { Collection<Application> domainApplications = deploymentService.findDomainApplications(""); assertThat(domainApplications, notNullValue()); assertThat(domainApplications.isEmpty(), is(true)); }
@Test public void shouldCloseTransactionsWhenIteratingOverSingleColumn() { // Given an execution result that has been started but not exhausted createNode(); createNode(); Result executionResult = db.execute( "CYPHER runtime=interpreted MATCH (n) RETURN n" ); ResourceIterator<Node> resultIterator = executionResult.columnAs( "n" ); resultIterator.next(); assertThat( activeTransaction(), is( notNullValue() ) ); // When resultIterator.close(); // Then assertThat( activeTransaction(), is( nullValue() ) ); }
@Override public void notify(DelegateExecution execution) { execution.setVariable("varName", "varValue", "activityId"); assertThat(execution.getVariableLocal("varName"), is(notNullValue())); }
protected void assertArtifactIsRegisteredAsZombie(String artifactName, Map<String, Map<URI, Long>> zombieMap) { assertEquals("Wrong number of zombie artifacts registered.", 1, zombieMap.size()); if (!zombieMap.containsKey(artifactName)) { Map.Entry<URI, Long> zombieEntry = getZombieFromMap((entry) -> new File((URI) entry.getKey()).getName().equals(artifactName), zombieMap); assertThat("Wrong URL tagged as zombie.", zombieEntry, is(notNullValue())); } }
@Test public void shouldReturnNonNullClaimWhenParsingBooleanValue() throws Exception { JsonNode value = mapper.valueToTree(Boolean.TRUE); Claim claim = claimFromNode(value); assertThat(claim, is(notNullValue())); assertThat(claim, is(instanceOf(JsonNodeClaim.class))); assertThat(claim.isNull(), is(false)); } }
@Test @TestForIssue( jiraKey = "HHH-11651") public void testUnwrappingConnectionProvider() { final MultiTenantConnectionProvider multiTenantConnectionProvider = serviceRegistry.getService( MultiTenantConnectionProvider.class ); final ConnectionProvider connectionProvider = multiTenantConnectionProvider.unwrap( ConnectionProvider.class ); assertThat( connectionProvider, is( notNullValue() ) ); }
@Test public void shouldPointToItself() { // given testRule.deploy(CALLED_PROCESS); // when ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(CALLED_PROCESS_KEY); // assume assertThat(processInstance.getRootProcessInstanceId(), notNullValue()); // then assertThat(processInstance.getRootProcessInstanceId(), is(processInstance.getProcessInstanceId())); }
@Test public void testMatcherFailureMessage() { final TestBaseMatcher matcher = new TestBaseMatcher().clickHandler(IsNull.<EventHandler<ClickEvent>>notNullValue(null)); final Condition<InspectableComponent> condition = BaseMatcherBuilder.buildCommonMatcher(matcher); condition.matches(mInspectableComponent); assertThat(condition.description().toString()) .isEqualTo("Click handler <not null> (doesn't match <null>)"); }
@Override public void execute(DelegateExecution execution) { execution.setVariable("varName", "varValue", "activityId"); assertThat(execution.getVariableLocal("varName"), is(notNullValue())); }
@Test public void shouldReturnNonNullClaimWhenParsingList() throws Exception { JsonNode value = mapper.valueToTree(new ArrayList<String>()); Claim claim = claimFromNode(value); assertThat(claim, is(notNullValue())); assertThat(claim, is(instanceOf(JsonNodeClaim.class))); assertThat(claim.isNull(), is(false)); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testRemoveAllWithWriterException() throws Exception { doAnswer(invocation -> { fail("expected CacheWritingException"); } catch (BulkCacheWritingException ex) { assertThat(ex.getFailures().size(), is(1)); assertThat(ex.getFailures().get(2), is(notNullValue())); assertThat(ex.getSuccesses().size(), is(3)); assertThat(ex.getSuccesses().containsAll(Arrays.asList(1, 3, 4)), is(true));
@Test public void shouldPointToItselfBySubmittingStartForm() { // given DeploymentWithDefinitions deployment = testRule.deploy(CALLED_PROCESS); String processDefinitionId = deployment.getDeployedProcessDefinitions().get(0).getId(); Map<String, Object> properties = new HashMap<>(); // when ProcessInstance processInstance = formService.submitStartForm(processDefinitionId, properties); // assume assertThat(processInstance.getRootProcessInstanceId(), notNullValue()); // then assertThat(processInstance.getRootProcessInstanceId(), is(processInstance.getProcessInstanceId())); }