Refine search
public ProcessInstanceAssert isStarted() { isNotNull(); Assertions.assertThat(actual.isEnded()). overridingErrorMessage("Expected processExecution %s to be started but it is not!", actual.getId()). isFalse(); return this; }
@Test public void testInvalidWhenLessThenThreeWords() throws Exception { boolean validated = haikuReview.validateLineCount("a//c"); assertThat(validated).isFalse(); }
@Test public void testIncorrectNumberOfSyllablesInThirdLineInNotHaiku() throws Exception { boolean isHaiku = haikuReview.isHaiku(INVALID_THIRD_LINE); assertThat(isHaiku).isFalse(); }
@Test public void testIsNotASyllable() throws Exception { boolean isSyllable = HaikuReview.isSyllable("code"); assertThat(isSyllable).isFalse(); }
private void assertEmptyNoOpCache() throws Exception { assertThat(mCache.edit("k1").isPresent()).isFalse(); assertThat(mCache.get("k1").isPresent()).isFalse(); mCache.remove("k1"); mCache.flush(); File journal = new File(IgDiskCache.FAKE_CACHE_DIRECTORY.getPath(), JOURNAL_FILE); assertThat(journal.exists()).isFalse(); }
@Test public void checkDeleteIfExistsNonExistent() throws IOException { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), "/path/to/file.txt", false ); assertThat( path.toFile().exists() ).isFalse(); assertThat( fsProvider.deleteIfExists( path ) ).isFalse(); assertThat( path.toFile().exists() ).isFalse(); }
@Test public void whenQueryingIsPlaying_thenReturnsFalse() { boolean isPlaying = facade.isPlaying(); assertThat(isPlaying).isFalse(); }
@Test public void shouldHaveCorrectConfiguration() { if ("debug".equals(BuildConfig.BUILD_TYPE)) { assertThat(BuildConfig.DEBUG).isTrue(); } else if ("release".equals(BuildConfig.BUILD_TYPE)) { assertThat(BuildConfig.DEBUG).isFalse(); } else { fail("build type configuration not tested or supported?"); } } }
@Test public void whenQueryingIsPlaying_thenReturnsFalse() { boolean isPlaying = player.isPlaying(); assertThat(isPlaying).isFalse(); }
@Test public void marshal_string_false_to_boolean_false() throws Exception { String rawFalse = "false"; assertThat(booleanBodyMarshaller.marshal(rawFalse)).isFalse(); }
@Test public void whenContentIsSecure_thenRequiresSecureDecoderIsFalse() throws MediaCodecUtil.DecoderQueryException { SecurityDowngradingCodecSelector securityDowngradingCodecSelector = new SecurityDowngradingCodecSelector(internalMediaCodecUtil); securityDowngradingCodecSelector.getDecoderInfos(ANY_MIME_TYPE, CONTENT_SECURE); ArgumentCaptor<Boolean> argumentCaptor = ArgumentCaptor.forClass(Boolean.class); verify(internalMediaCodecUtil).getDecoderInfos(eq(ANY_MIME_TYPE), argumentCaptor.capture()); assertThat(argumentCaptor.getValue()).isFalse(); }
@Test public void whenContentIsInsecure_thenRequiresSecureDecoderIsFalse() throws MediaCodecUtil.DecoderQueryException { SecurityDowngradingCodecSelector securityDowngradingCodecSelector = new SecurityDowngradingCodecSelector(internalMediaCodecUtil); securityDowngradingCodecSelector.getDecoderInfos(ANY_MIME_TYPE, CONTENT_INSECURE); ArgumentCaptor<Boolean> argumentCaptor = ArgumentCaptor.forClass(Boolean.class); verify(internalMediaCodecUtil).getDecoderInfos(eq(ANY_MIME_TYPE), argumentCaptor.capture()); assertThat(argumentCaptor.getValue()).isFalse(); }
@Test public void testOnlyAllowLowercase() throws Exception { String lowercase = "a"; String uppercase = "A"; boolean valid = haikuReview.validateHaikuCharacters(lowercase); assertThat(valid).isTrue(); boolean invalid = haikuReview.validateHaikuCharacters(uppercase); assertThat(invalid).isFalse(); }
@Test public void givenDrmDataDoesNotContainDrmScheme_whenCheckingCanAcquireSession_thenReturnsFalse() { DrmInitData.SchemeData unrecognisedSchemeData = new DrmInitData.SchemeData( UUID.randomUUID(), "ANY_MIME_TYPE", new byte[]{} ); DrmInitData drmInitData = new DrmInitData(Collections.singletonList(unrecognisedSchemeData)); boolean canAcquireSession = localDrmSessionManager.canAcquireSession(drmInitData); assertThat(canAcquireSession).isFalse(); }
@Test public void checkCreateDirectory() { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final String userBasedPath = System.getProperty( "user.dir" ) + "/temp"; final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false ); path.toFile().delete(); assertThat( path.toFile().exists() ).isFalse(); fsProvider.createDirectory( path ); assertThat( path.toFile().exists() ).isTrue(); path.toFile().delete(); assertThat( path.toFile().exists() ).isFalse(); }
@Test public void checkNewByteChannelToCreateFile() throws IOException { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final String userBasedPath = System.getProperty( "user.dir" ) + "/byte_some_file_here.txt"; final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false ); assertThat( path.toFile().exists() ).isFalse(); final SeekableByteChannel channel = fsProvider.newByteChannel( path, null ); assertThat( channel ).isNotNull(); assertThat( path.toFile().exists() ).isTrue(); path.toFile().delete(); assertThat( path.toFile().exists() ).isFalse(); }
@Test public void givenAnAnimationIsPartOfASetWhenWeAskThenThereItSaysItIsNotANewAnimation() throws Exception { String setKey = "TestKey"; tracker.isTheStartOfANewAnimationSet(setKey, ANY_DURATION); boolean startOfANewAnimation = tracker.isTheStartOfANewAnimationSet(setKey, ANY_DURATION); assertThat(startOfANewAnimation).isFalse(); }
@Test(expected = org.kie.commons.java.nio.IOException.class) public void newByteChannelInvalidPath() throws IOException { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final String userBasedPath = System.getProperty( "user.dir" ) + "path/to/some_file_here.txt"; final Path path = GeneralPathImpl.create( fsProvider.getFileSystem( URI.create( "file:///" ) ), userBasedPath, false ); assertThat( path.toFile().exists() ).isFalse(); fsProvider.newByteChannel( path, null ); }
@Test public void checkDelete() throws IOException { final SimpleFileSystemProvider fsProvider = new SimpleFileSystemProvider(); final File tempFile = File.createTempFile( "foo", "bar" ); final Path path = GeneralPathImpl.newFromFile( fsProvider.getFileSystem( URI.create( "file:///" ) ), tempFile ); assertThat( path.toFile().exists() ).isTrue(); fsProvider.delete( path ); assertThat( path.toFile().exists() ).isFalse(); }
/** Tests the {@link Tag#equals(Object)} method. */ public void testEquals() throws Throwable { final Tag tag1 = new Tag("duck", Tag.Type.CHARACTER); final Tag tag2 = new Tag("duck", Tag.Type.CHARACTER); final Tag tag3 = new Tag("bird", Tag.Type.CHARACTER); final Tag tag4 = new Tag("duck", Tag.Type.ARTIST); // Two tags with the same name and type should be equal to one another. assertThat(tag1.equals(tag2)).isTrue(); assertThat(tag1.equals(tag3)).isFalse(); assertThat(tag1.equals(tag4)).isFalse(); }