@Test public void getSecureMungedAddress() { byte[] address = MacAddressProvider.getSecureMungedAddress(); assertThat(address).isNotEmpty(); assertThat(address).hasSize(6); }
@Test public void constructDummyMulticastAddress() { byte[] address = MacAddressProvider.constructDummyMulticastAddress(); assertThat(address).isNotEmpty(); assertThat(address).hasSize(6); } }
@Test public void select() { dbTester.prepareDbUnit(getClass(), "shared.xml"); FileSourceDto fileSourceDto = underTest.selectByFileUuid(dbSession, "FILE1_UUID"); assertThat(fileSourceDto.getBinaryData()).isNotEmpty(); assertThat(fileSourceDto.getDataHash()).isEqualTo("hash"); assertThat(fileSourceDto.getProjectUuid()).isEqualTo("PRJ_UUID"); assertThat(fileSourceDto.getFileUuid()).isEqualTo("FILE1_UUID"); assertThat(fileSourceDto.getCreatedAt()).isEqualTo(1500000000000L); assertThat(fileSourceDto.getUpdatedAt()).isEqualTo(1500000000000L); assertThat(fileSourceDto.getRevision()).isEqualTo("123456789"); assertThat(fileSourceDto.getLineHashesVersion()).isEqualTo(0); }
@Test public void dataSerializes() throws Exception { EvictionAttributesImpl evictionAttributes = new EvictionAttributesImpl(); byte[] bytes = BlobHelper.serializeToBlob(evictionAttributes); assertThat(bytes).isNotNull().isNotEmpty(); assertThat(BlobHelper.deserializeBlob(bytes)).isNotSameAs(evictionAttributes) .isInstanceOf(EvictionAttributesImpl.class); }
@Test public void dataSerializes() throws Exception { PartitionRegionConfig config = new PartitionRegionConfig(prId, path, partitionAttributes, scope, evictionAttributes, regionIdleTimeout, regionTimeToLive, entryIdleTimeout, entryTimeToLive, gatewaySenderIds); byte[] bytes = BlobHelper.serializeToBlob(config); assertThat(bytes).isNotNull().isNotEmpty(); assertThat(BlobHelper.deserializeBlob(bytes)).isNotSameAs(config) .isInstanceOf(PartitionRegionConfig.class); }
@Test public void serializes() throws Exception { EvictionAttributesImpl evictionAttributes = new EvictionAttributesImpl(); byte[] bytes = SerializationUtils.serialize(evictionAttributes); assertThat(bytes).isNotNull().isNotEmpty(); assertThat((EvictionAttributesImpl) SerializationUtils.deserialize(bytes)) .isNotSameAs(evictionAttributes) .isInstanceOf(EvictionAttributesImpl.class); } }
@Ignore("GEODE-4812") @Test public void serializes() throws Exception { PartitionRegionConfig config = new PartitionRegionConfig(); byte[] bytes = SerializationUtils.serialize(config); assertThat(bytes).isNotNull().isNotEmpty(); assertThat((PartitionRegionConfig) SerializationUtils.deserialize(bytes)).isNotSameAs(config) .isInstanceOf(PartitionRegionConfig.class); } }
@Test public void persist_sources() { List<String> lineHashes = Arrays.asList("137f72c3708c6bd0de00a0e5a69c699b", "e6251bcf1a7dc3ba5e7933e325bbe605"); String sourceHash = "ee5a58024a155466b43bc559d953e018"; DbFileSources.Data fileSourceData = DbFileSources.Data.newBuilder() .addAllLines(Arrays.asList( DbFileSources.Line.newBuilder().setSource("line1").setLine(1).build(), DbFileSources.Line.newBuilder().setSource("line2").setLine(2).build())) .build(); when(fileSourceDataComputer.compute(fileComponent().build(), fileSourceDataWarnings)) .thenReturn(new FileSourceDataComputer.Data(fileSourceData, lineHashes, sourceHash, null)); underTest.execute(new TestComputationStepContext()); assertThat(dbTester.countRowsOfTable("file_sources")).isEqualTo(1); FileSourceDto fileSourceDto = dbClient.fileSourceDao().selectByFileUuid(session, FILE1_UUID); assertThat(fileSourceDto.getProjectUuid()).isEqualTo(PROJECT_UUID); assertThat(fileSourceDto.getFileUuid()).isEqualTo(FILE1_UUID); assertThat(fileSourceDto.getBinaryData()).isNotEmpty(); assertThat(fileSourceDto.getDataHash()).isNotEmpty(); assertThat(fileSourceDto.getLineHashesVersion()).isEqualTo(LineHashVersion.WITHOUT_SIGNIFICANT_CODE.getDbValue()); assertThat(fileSourceDto.getLineHashes()).isNotEmpty(); assertThat(fileSourceDto.getCreatedAt()).isEqualTo(NOW); assertThat(fileSourceDto.getUpdatedAt()).isEqualTo(NOW); DbFileSources.Data data = fileSourceDto.getSourceData(); assertThat(data.getLinesCount()).isEqualTo(2); assertThat(data.getLines(0).getLine()).isEqualTo(1); assertThat(data.getLines(0).getSource()).isEqualTo("line1"); assertThat(data.getLines(1).getLine()).isEqualTo(2); assertThat(data.getLines(1).getSource()).isEqualTo("line2"); verify(fileSourceDataWarnings).commitWarnings(); }
private long readValueFromDefaultCell(TableReference tableRef, long ts) { byte[] cellContents = Iterables.getOnlyElement(readFromDefaultCell(tableRef, ts).values()).getContents(); assertThat(cellContents).as("Reading value from table %s at timestamp %s", tableRef, ts).isNotEmpty(); return PtBytes.toLong(cellContents); }
@Test public void tablesWithDifferentCapitalizationClaimToHaveMetadata() { kvs.createTable(UPPER_UPPER, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.createTable(LOWER_UPPER, AtlasDbConstants.GENERIC_TABLE_METADATA); TABLES.forEach(table -> assertThat(kvs.getMetadataForTable(table)).isNotEmpty()); assertThat(kvs.getMetadataForTable(TableReference.createFromFullyQualifiedName("other.table"))).isEmpty(); }
public AssertFileContent isFile() { assertThat(response).isNotNull(); assertThat(response.getContentType()).isNotNull(); assertThat(response.getContentAsByteArray()).isNotEmpty(); assertThat(response.getHeader(CONTENT_DISPOSITION)) .isNotEmpty() .startsWith(ATTACHMENT_CONTENT_DISPOSITION); String filename = response.getHeader(CONTENT_DISPOSITION) .substring(ATTACHMENT_CONTENT_DISPOSITION.length()); return new AssertFileContent(new FileContent(filename, response.getContentType(), response.getContentAsByteArray())); }
@Test public void sendRawTransaction() { byte[] res = txApiImpl.sendRawTransaction(tx.toBinary()); log.debug("\n\nres :: " + Hex.encodeHexString(res)); assertThat(res).isNotEmpty(); } }
@Test public void sendRawTransactionTest() { // Request Transaction with byteArr try { byte[] input = createTx().toBinary(); // Convert byteArray to Transaction assertThat(TX_API.sendRawTransaction(input)).isNotEmpty(); } catch (Exception e) { log.debug(e.getMessage()); } }
@Test public void testWithBinary(TestContext tc) { Async async = tc.async(); retriever = ConfigRetriever.create(vertx, new ConfigRetrieverOptions() .addStore( new ConfigStoreOptions() .setType("file") .setFormat("raw") .setConfig( new JsonObject() .put("path", "src/test/resources/raw/logo-white-big.png") .put("raw.type", "binary") .put("raw.key", "logo"))) ); retriever.getConfig(ar -> { assertThat(ar.result()).isNotNull().isNotEmpty(); assertThat(ar.result().getBinary("logo")).isNotEmpty(); async.complete(); }); }
@Test public void testWithBinary(TestContext tc) { Async async = tc.async(); retriever = ConfigRetriever.create(vertx, new ConfigRetrieverOptions() .addStore( new ConfigStoreOptions() .setType("file") .setFormat("raw") .setConfig( new JsonObject() .put("path", "src/test/resources/raw/logo-white-big.png") .put("raw.type", "binary") .put("raw.key", "logo"))) ); retriever.getConfig(ar -> { assertThat(ar.result()).isNotNull().isNotEmpty(); assertThat(ar.result().getBinary("logo")).isNotEmpty(); async.complete(); }); }
assertThat(json.getBinary("picture")).isNotEmpty();