org.hamcrest.core.Is.is()

Here are the examples of the java api org.hamcrest.core.Is.is() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

180 Examples 7

19 Source : YamlConfigPluginIntegrationTest.java
with Apache License 2.0
from tomzo

private void replacedertNoError(JsonObject responseJsonObject) {
    replacedertThat(responseJsonObject.get("errors"), Is.<JsonElement>is(new JsonArray()));
}

19 Source : Matchers.java
with MIT License
from Qihoo360

/**
 * Creates a Matcher that matches when the examined string is equal to the
 * specified {@code value} when all Windows-style line endings ("\r\n")
 * have been converted to Unix-style line endings ("\n").
 *
 * <p>Thus, if {@code foo()} is a function that returns "hello{newline}world"
 * in the current operating system's line endings, then
 *
 * <blockquote>
 *   replacedertThat(foo(), isLinux("hello\nworld"));
 * </blockquote>
 *
 * <p>will succeed on all platforms.
 *
 * @see Util#toLinux(String)
 */
@Factory
public static Matcher<String> isLinux(final String value) {
    return compose(Is.is(value), input -> input == null ? null : Util.toLinux(input));
}

19 Source : NestedFieldQueryIT.java
with Apache License 2.0
from opendistro-for-elasticsearch

@Test
public void nestedFiledIsNotNull() throws IOException {
    String sql = "SELECT e.name " + "FROM elasticsearch-sql_test_index_employee_nested as e, e.projects as p " + "WHERE p IS NOT NULL";
    replacedertThat(executeQuery(sql), hitAll(kvString("/_source/name", Is.is("Bob Smith")), kvString("/_source/name", Is.is("Jane Smith"))));
}

19 Source : SimpleEventsProcessorTest.java
with Apache License 2.0
from mzheravin

@Test
public void shouldHandleWithReduceCommand() {
    OrderCommand cmd = sampleReduceCommand();
    cmd.matcherEvent = MatcherTradeEvent.builder().eventType(MatcherEventType.REDUCE).activeOrderCompleted(true).price(20100L).size(8272L).nextEvent(null).build();
    processor.accept(cmd, 192837L);
    verify(handler, times(1)).commandResult(commandResultCaptor.capture());
    verify(handler, never()).tradeEvent(any());
    verify(handler, never()).rejectEvent(any());
    verify(handler, times(1)).reduceEvent(reduceEventCaptor.capture());
    replacedertThat(commandResultCaptor.getValue().getCommand(), Is.is(ApiReduceOrder.builder().orderId(123L).reduceSize(3200L).symbol(3).uid(29851L).build()));
    replacedertThat(reduceEventCaptor.getValue().getOrderId(), Is.is(123L));
    replacedertThat(reduceEventCaptor.getValue().getPrice(), Is.is(20100L));
    replacedertThat(reduceEventCaptor.getValue().getReducedVolume(), Is.is(8272L));
    replacedertTrue(reduceEventCaptor.getValue().isOrderCompleted());
}

19 Source : KucoinRestClientTest.java
with MIT License
from Kucoin

/**
 * Check that we can get all account balances.
 */
@Test
public void accountAPIMulti() throws Exception {
    List<AccountBalancesResponse> accountBalancesResponses = sandboxKucoinRestClient.accountAPI().listAccounts(null, null);
    replacedertThat(accountBalancesResponses.size(), Is.is(6));
}

19 Source : KucoinRestClientTest.java
with MIT License
from Kucoin

@Test
public void userAPI() throws Exception {
    List<SubUserInfoResponse> subUserInfoResponses = sandboxKucoinRestClient.userAPI().listSubUsers();
    replacedertThat(subUserInfoResponses.size(), Is.is(1));
}

19 Source : KucoinPublicWSClientTest.java
with MIT License
from Kucoin

@Test
public void ping() throws Exception {
    String requestId = "1234567890";
    String ping = kucoinPublicWSClient.ping(requestId);
    replacedertThat(ping, Is.is(requestId));
}

19 Source : KucoinPrivateWSClientTest.java
with MIT License
from Kucoin

private void innerTransfer2() throws IOException {
    List<AccountBalancesResponse> accountBalancesResponses = kucoinRestClient.accountAPI().listAccounts("USDT", null);
    replacedertThat(accountBalancesResponses.size(), Is.is(2));
    kucoinRestClient.accountAPI().innerTransfer2(new AccountTransferV2Request(String.valueOf(System.currentTimeMillis()), "USDT", "trade", "main", new BigDecimal("0.000001")));
}

19 Source : KucoinPrivateWSClientTest.java
with MIT License
from Kucoin

@Test
public void ping() throws Exception {
    String requestId = "1234567890";
    String ping = kucoinPrivateWSClient.ping(requestId);
    replacedertThat(ping, Is.is(requestId));
}

19 Source : StreamQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetColumnCount() throws SQLException {
    StreamQueryResult queryResult = new StreamQueryResult(getResultSet());
    replacedertThat(queryResult.getColumnCount(), Is.is(1));
}

19 Source : StreamQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetColumnLabel() throws SQLException {
    StreamQueryResult queryResult = new StreamQueryResult(getResultSet());
    replacedertThat(queryResult.getColumnLabel(1), Is.is("order_id"));
}

19 Source : StreamQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithColumnIndex() throws SQLException {
    StreamQueryResult queryResult = new StreamQueryResult(getResultSet());
    queryResult.next();
    replacedertThat(queryResult.getValue(1, Integer.clreplaced), Is.<Object>is(1));
}

19 Source : StreamQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithShardingRule() throws SQLException {
    when(shardingEncryptor.decrypt("1")).thenReturn("1");
    StreamQueryResult queryResult = new StreamQueryResult(getResultSet(), getShardingRule());
    queryResult.next();
    replacedertThat(queryResult.getValue("order_id", Integer.clreplaced), Is.<Object>is("1"));
}

19 Source : StreamQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithColumnLabel() throws SQLException {
    StreamQueryResult queryResult = new StreamQueryResult(getResultSet());
    queryResult.next();
    replacedertThat(queryResult.getValue("order_id", Integer.clreplaced), Is.<Object>is(1));
}

19 Source : MemoryQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithColumnIndex() throws SQLException {
    MemoryQueryResult queryResult = new MemoryQueryResult(getResultSet());
    queryResult.next();
    replacedertThat(queryResult.getValue(1, Integer.clreplaced), Is.<Object>is(1));
}

19 Source : MemoryQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithColumnLabel() throws SQLException {
    MemoryQueryResult queryResult = new MemoryQueryResult(getResultSet());
    queryResult.next();
    replacedertThat(queryResult.getValue("order_id", Integer.clreplaced), Is.<Object>is(1));
}

19 Source : MemoryQueryResultTest.java
with Apache License 2.0
from gszebra

@Test
public void replacedertGetValueWithShardingRule() throws SQLException {
    when(shardingEncryptor.decrypt("1")).thenReturn("1");
    MemoryQueryResult queryResult = new MemoryQueryResult(getResultSet(), getShardingRule());
    queryResult.next();
    replacedertThat(queryResult.getValue("order_id", Integer.clreplaced), Is.<Object>is("1"));
}

19 Source : TestProjectInspector.java
with MIT License
from eclipse

private Build checkBuildAndReturn(long buildId, boolean isPR) {
    Optional<Build> optionalBuild = RepairnatorConfig.getInstance().getJTravis().build().fromId(buildId);
    int retryCount = 0;
    while (!optionalBuild.isPresent()) {
        if (retryCount > 3) {
            break;
        }
    }
    replacedertTrue(optionalBuild.isPresent());
    Build build = optionalBuild.get();
    replacedertThat(build, notNullValue());
    replacedertThat(buildId, Is.is(build.getId()));
    replacedertThat(build.isPullRequest(), Is.is(isPR));
    return build;
}

19 Source : LocalServiceRegistryClientImplTest.java
with Apache License 2.0
from apache

@Test
public void testLoadSchemaIdsFromRegistryFile() {
    Microservice microservice = registryClient.getMicroservice("002");
    replacedert.replacedertThat(microservice.getSchemas().size(), Is.is(1));
    replacedert.replacedertTrue(microservice.getSchemas().contains("hello"));
}

19 Source : OmEncoderv20Test.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeFeatureWithNilWhenMissingInObservationTemplate() throws EncodingException {
    OmObservationConstellation observationTemplate = new OmObservationConstellation();
    String observationType = OmConstants.OBS_TYPE_MEASUREMENT;
    observationTemplate.setObservationType(observationType);
    observationTemplate.setObservableProperty(new OmObservableProperty(observedProperty));
    OMObservationType encodedObservationTemplate = (OMObservationType) omEncoderv20.encode(observationTemplate);
    replacedertThat(encodedObservationTemplate.getFeatureOfInterest().isNil(), Is.is(false));
    replacedertThat(encodedObservationTemplate.getFeatureOfInterest().isSetNilReason(), Is.is(true));
    replacedertThat(encodedObservationTemplate.getFeatureOfInterest().getNilReason(), Is.is("template"));
}

19 Source : OmEncoderv20Test.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeTimeFieldsInObservationTemplate() throws EncodingException {
    OmObservationConstellation observationTemplate = new OmObservationConstellation();
    String observationType = OmConstants.OBS_TYPE_MEASUREMENT;
    observationTemplate.setObservationType(observationType);
    observationTemplate.setObservableProperty(new OmObservableProperty(observedProperty));
    OMObservationType encodedObservationTemplate = (OMObservationType) omEncoderv20.encode(observationTemplate);
    replacedertThat(encodedObservationTemplate.getPhenomenonTime().isNil(), Is.is(false));
    replacedertThat(encodedObservationTemplate.getPhenomenonTime().isSetNilReason(), Is.is(true));
    replacedertThat(encodedObservationTemplate.getPhenomenonTime().getNilReason(), Is.is("template"));
    replacedertThat(encodedObservationTemplate.getResultTime().isNil(), Is.is(false));
    replacedertThat(encodedObservationTemplate.getResultTime().isSetNilReason(), Is.is(true));
    replacedertThat(encodedObservationTemplate.getResultTime().getNilReason(), Is.is("template"));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeMeasurementLocationIdentifier() throws EncodingException {
    final String actual = getResponseString()[4];
    final String expected = "$sb Mess-Stellennummer: " + foiIdentifier.substring(foiIdentifier.length() - UVFConstants.MAX_IDENTIFIER_LENGTH, foiIdentifier.length());
    replacedertThat(actual, Is.is(expected));
    replacedertThat(actual.length(), Is.is(39));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeUnitOfMeasurement() throws EncodingException {
    final String actual = getResponseString()[3];
    final String expected = "$sb Mess-Einheit: " + unit;
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeIndexUnitTime() throws EncodingException {
    replacedertThat(getResponseString()[1], Is.is("$sb Index-Einheit: *** Zeit ***"));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeTemporalBoundingBox() throws EncodingException {
    final String actual = getResponseString()[9];
    final String expected = "70010112007001011200Zeit    ";
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeTimeseriesIdentifierAndCenturies() throws EncodingException, OwsExceptionReport {
    final String actual = getResponseString()[7];
    final String expected = obsPropIdentifier.substring(obsPropIdentifier.length() - UVFConstants.MAX_IDENTIFIER_LENGTH, obsPropIdentifier.length()) + " " + unit + "     " + "1900 1900";
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeFunctionInterpretationLine() throws EncodingException {
    replacedertThat(getResponseString()[0], Is.is("$ib Funktion-Interpretation: Linie"));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeSingleObservationValueAndTimestamp() throws EncodingException, OwsExceptionReport {
    final String actual = getResponseString()[10];
    final String expected = "700101120052.0      ";
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeTimeseriesTypeIdentifierTimebased() throws EncodingException {
    replacedertThat(getResponseString()[6], Is.is("*Z"));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeMeasurementLocationIdAndCoordinates() throws EncodingException, OwsExceptionReport {
    final String actual = getResponseString()[8];
    final String expected = "1              7.6521225 51.9350382          ";
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeMeasurementLocationName() throws EncodingException {
    final String actual = getResponseString()[5];
    final String expected = "$sb Mess-Stellenname: " + foiName;
    replacedertThat(actual, Is.is(expected));
}

19 Source : UVFEncoderTest.java
with Apache License 2.0
from 52North

@Test
public void shouldEncodeMeasurementIdentifier() throws EncodingException {
    final String actual = getResponseString()[2];
    final String expected = "$sb Mess-Groesse: " + obsPropIdentifier.substring(obsPropIdentifier.length() - UVFConstants.MAX_IDENTIFIER_LENGTH, obsPropIdentifier.length());
    replacedertThat(actual, Is.is(expected));
    replacedertThat(actual.length(), Is.is(33));
}

18 Source : RansackXssTest.java
with GNU General Public License v3.0
from techguy-bhushan

@Test
public void testRansackXssValue() {
    RansackXss ransackXss = new DefaultRansackXssImpl();
    String filteredValue = ransackXss.ransackXss(parameterValue);
    replacedertNotNull(filteredValue);
    replacedertThat(filteredValue, Is.is(expected));
}

18 Source : CatResourceTest.java
with Apache License 2.0
from quarkusio

@Test
void testCustomFindPublicationYearObject() {
    when().get("/cat/customFindDistinctive/2").then().statusCode(200).body(Is.is("true"));
}

18 Source : Matchers.java
with Apache License 2.0
from polypheny

/**
 * Creates a Matcher that matches when the examined string is equal to the specified {@code value} when all Windows-style line endings ("\r\n") have been converted to Unix-style line endings ("\n").
 *
 * Thus, if {@code foo()} is a function that returns "hello{newline}world" in the current operating system's line endings, then
 *
 * <blockquote>
 * replacedertThat(foo(), isLinux("hello\nworld"));
 * </blockquote>
 *
 * will succeed on all platforms.
 *
 * @see Util#toLinux(String)
 */
@Factory
public static Matcher<String> isLinux(final String value) {
    return compose(Is.is(value), input -> input == null ? null : Util.toLinux(input));
}

18 Source : BaseDataObjectTest.java
with Apache License 2.0
from NationalSecurityAgency

@Test
public void testDefaultConstructor_getSetDateTime() {
    // setup
    final Date date = new Date(0);
    // test
    this.b.setCreationTimestamp(date);
    // verify
    replacedertThat(this.b.getCreationTimestamp(), Is.is(date));
}

18 Source : ExchangeTestContainer.java
with Apache License 2.0
from mzheravin

public void initBasicUser(long uid) {
    replacedertThat(api.submitCommandAsync(ApiAddUser.builder().uid(uid).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(1L).amount(10_000_00L).currency(TestConstants.CURRENECY_USD).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(2L).amount(1_0000_0000L).currency(TestConstants.CURRENECY_XBT).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(3L).amount(1_0000_0000L).currency(TestConstants.CURRENECY_ETH).build()).join(), Is.is(CommandResultCode.SUCCESS));
}

18 Source : ExchangeTestContainer.java
with Apache License 2.0
from mzheravin

public void resetExchangeCore() {
    final CommandResultCode res = api.submitCommandAsync(ApiReset.builder().build()).join();
    replacedertThat(res, Is.is(CommandResultCode.SUCCESS));
}

18 Source : ExchangeTestContainer.java
with Apache License 2.0
from mzheravin

public void initFeeUser(long uid) {
    replacedertThat(api.submitCommandAsync(ApiAddUser.builder().uid(uid).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(1L).amount(10_000_00L).currency(TestConstants.CURRENECY_USD).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(2L).amount(10_000_000L).currency(TestConstants.CURRENECY_JPY).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(3L).amount(1_0000_0000L).currency(TestConstants.CURRENECY_XBT).build()).join(), Is.is(CommandResultCode.SUCCESS));
    replacedertThat(api.submitCommandAsync(ApiAdjustUserBalance.builder().uid(uid).transactionId(4L).amount(1000_0000_0000L).currency(TestConstants.CURRENECY_LTC).build()).join(), Is.is(CommandResultCode.SUCCESS));
}

18 Source : ExchangeTestContainer.java
with Apache License 2.0
from mzheravin

public void submitCommandSync(ApiCommand apiCommand, CommandResultCode expectedResultCode) {
    replacedertThat(api.submitCommandAsync(apiCommand).join(), Is.is(expectedResultCode));
}

18 Source : ExchangeTestContainer.java
with Apache License 2.0
from mzheravin

public void sendBinaryDataCommandSync(final BinaryDataCommand data, final int timeOutMs) {
    final Future<CommandResultCode> future = api.submitBinaryDataAsync(data);
    try {
        replacedertThat(future.get(timeOutMs, TimeUnit.MILLISECONDS), Is.is(CommandResultCode.SUCCESS));
    } catch (final InterruptedException | ExecutionException | TimeoutException ex) {
        log.error("Failed sending binary data command", ex);
        throw new RuntimeException(ex);
    }
}

18 Source : SimpleEventsProcessorTest.java
with Apache License 2.0
from mzheravin

@Test
public void shouldHandlerWithSingleReject() {
    OrderCommand cmd = samplePlaceOrderCommand();
    cmd.matcherEvent = MatcherTradeEvent.builder().eventType(MatcherEventType.REJECT).activeOrderCompleted(true).size(8272L).price(52201L).nextEvent(null).build();
    processor.accept(cmd, 192837L);
    verify(handler, times(1)).commandResult(commandResultCaptor.capture());
    verify(handler, never()).tradeEvent(any());
    verify(handler, never()).reduceEvent(any());
    verify(handler, times(1)).rejectEvent(rejectEventCaptor.capture());
    replacedertThat(commandResultCaptor.getValue().getCommand(), Is.is(ApiPlaceOrder.builder().orderId(123L).symbol(3).price(52200L).size(3200L).reservePrice(12800L).action(OrderAction.BID).orderType(OrderType.IOC).uid(29851L).userCookie(44188).build()));
    IEventsHandler.RejectEvent rejectEvent = rejectEventCaptor.getValue();
    replacedertThat(rejectEvent.getSymbol(), Is.is(3));
    replacedertThat(rejectEvent.getOrderId(), Is.is(123L));
    replacedertThat(rejectEvent.getRejectedVolume(), Is.is(8272L));
    replacedertThat(rejectEvent.getPrice(), Is.is(52201L));
    replacedertThat(rejectEvent.getUid(), Is.is(29851L));
}

18 Source : SimpleEventsProcessorTest.java
with Apache License 2.0
from mzheravin

@Test
public void shouldHandleWithSingleTrade() {
    OrderCommand cmd = samplePlaceOrderCommand();
    cmd.matcherEvent = MatcherTradeEvent.builder().eventType(MatcherEventType.TRADE).activeOrderCompleted(false).matchedOrderId(276810L).matchedOrderUid(10332L).matchedOrderCompleted(true).price(20100L).size(8272L).nextEvent(null).build();
    processor.accept(cmd, 192837L);
    verify(handler, times(1)).commandResult(commandResultCaptor.capture());
    verify(handler, never()).rejectEvent(any());
    verify(handler, never()).reduceEvent(any());
    verify(handler, times(1)).tradeEvent(tradeEventCaptor.capture());
    replacedertThat(commandResultCaptor.getValue().getCommand(), Is.is(ApiPlaceOrder.builder().orderId(123L).symbol(3).price(52200L).size(3200L).reservePrice(12800L).action(OrderAction.BID).orderType(OrderType.IOC).uid(29851).userCookie(44188).build()));
    IEventsHandler.TradeEvent tradeEvent = tradeEventCaptor.getValue();
    replacedertThat(tradeEvent.getSymbol(), Is.is(3));
    replacedertThat(tradeEvent.getTotalVolume(), Is.is(8272L));
    replacedertThat(tradeEvent.getTakerOrderId(), Is.is(123L));
    replacedertThat(tradeEvent.getTakerUid(), Is.is(29851L));
    replacedertThat(tradeEvent.getTakerAction(), Is.is(OrderAction.BID));
    replacedertFalse(tradeEvent.isTakeOrderCompleted());
    List<IEventsHandler.Trade> trades = tradeEvent.getTrades();
    replacedertThat(trades.size(), Is.is(1));
    IEventsHandler.Trade trade = trades.get(0);
    replacedertThat(trade.getMakerOrderId(), Is.is(276810L));
    replacedertThat(trade.getMakerUid(), Is.is(10332L));
    replacedertTrue(trade.isMakerOrderCompleted());
    replacedertThat(trade.getPrice(), Is.is(20100L));
    replacedertThat(trade.getVolume(), Is.is(8272L));
}

18 Source : SimpleEventsProcessorTest.java
with Apache License 2.0
from mzheravin

@Test
public void shouldHandleSimpleCommand() {
    OrderCommand cmd = sampleCancelCommand();
    processor.accept(cmd, 192837L);
    verify(handler, times(1)).commandResult(commandResultCaptor.capture());
    verify(handler, never()).tradeEvent(any());
    verify(handler, never()).rejectEvent(any());
    verify(handler, never()).reduceEvent(any());
    replacedertThat(commandResultCaptor.getValue().getCommand(), Is.is(ApiCancelOrder.builder().orderId(123L).symbol(3).uid(29851L).build()));
}

18 Source : PasswordServiceTest.java
with GNU General Public License v3.0
from Lottoritter

@Test
public void createMD5() {
    PreplacedwordService cut = new PreplacedwordService();
    replacedertThat(cut.createMD5("123456"), Is.is("6dbeca3ec141a1759896c9e191fd2dca"));
}

18 Source : EncryptionServiceTest.java
with GNU General Public License v3.0
from Lottoritter

@Test
public void decryptData() throws Exception {
    final String base64Encoded = "hfZcGLKmy9Q9iPRR+3XfmV7TzHoYU+6NKvJk4gSZfI0=";
    EncryptionService cut = new EncryptionService();
    cut.encryptionKey = createEncryptionKey("01234567890123456789012345678912");
    replacedertThat(new String(cut.decryptData(Base64.getDecoder().decode(base64Encoded))), Is.is("[email protected]"));
}

18 Source : LocalRegistryServerIT.java
with Apache License 2.0
from hortonworks

@Test
public void listAggregatedSchemas_OrderCompatibility() throws Exception {
    // given
    List<SchemaMetadata> expecteds = new ArrayList<SchemaMetadata>();
    expecteds.add(schemaMetadata_0);
    expecteds.add(schemaMetadata_2);
    // when
    TestResponse schemaMetadataInfo = createSchemaMetadataInfoFromQuery("/schemaregistry/schemas/aggregated?compatibility=BACKWARD&_orderByFields=timestamp,a", schemaRegistryTestServerClientWrapper, restClient);
    SchemaMetadataInfo actual_1 = (SchemaMetadataInfo) ((ArrayList) schemaMetadataInfo.getEnreplacedies()).get(0);
    SchemaMetadataInfo actual_2 = (SchemaMetadataInfo) ((ArrayList) schemaMetadataInfo.getEnreplacedies()).get(1);
    List<SchemaMetadata> actuals = new ArrayList<SchemaMetadata>();
    actuals.add(actual_1.getSchemaMetadata());
    actuals.add(actual_2.getSchemaMetadata());
    // then
    replacedert.replacedertThat(actuals, Is.is(expecteds));
}

18 Source : LocalRegistryServerIT.java
with Apache License 2.0
from hortonworks

@Test
public void listAggregatedSchemas_NameDescSchemaGroup() throws Exception {
    // given
    SchemaMetadataInfo expected = schemaMetadataInfo2;
    // when
    TestResponse schemaMetadataInfo = createSchemaMetadataInfoFromQuery("/schemaregistry/schemas/aggregated?name=plutonium&desc=spacemacs&schemaGroup=Kafka", schemaRegistryTestServerClientWrapper, restClient);
    SchemaMetadataInfo actual = (SchemaMetadataInfo) ((ArrayList) schemaMetadataInfo.getEnreplacedies()).get(0);
    // then
    replacedert.replacedertThat(actual.getSchemaMetadata(), Is.is(expected.getSchemaMetadata()));
    replacedert.replacedertThat(actual.getId(), Is.is(expected.getId()));
}

18 Source : LocalRegistryServerIT.java
with Apache License 2.0
from hortonworks

@Test
public void listSchemas_OrderCompatibility() throws Exception {
    // given
    List<SchemaMetadata> expecteds = new ArrayList<SchemaMetadata>();
    expecteds.add(schemaMetadata_0);
    expecteds.add(schemaMetadata_2);
    // when
    TestResponse schemaMetadataInfo = createSchemaMetadataInfoFromQuery("/schemaregistry/schemas?compatibility=BACKWARD&_orderByFields=timestamp,a", schemaRegistryTestServerClientWrapper, restClient);
    SchemaMetadataInfo actual_1 = (SchemaMetadataInfo) ((ArrayList) schemaMetadataInfo.getEnreplacedies()).get(0);
    SchemaMetadataInfo actual_2 = (SchemaMetadataInfo) ((ArrayList) schemaMetadataInfo.getEnreplacedies()).get(1);
    List<SchemaMetadata> actuals = new ArrayList<SchemaMetadata>();
    actuals.add(actual_1.getSchemaMetadata());
    actuals.add(actual_2.getSchemaMetadata());
    // then
    replacedert.replacedertThat(actuals, Is.is(expecteds));
}

18 Source : LocalRegistryServerIT.java
with Apache License 2.0
from hortonworks

@Test
public void listSchemas_NameOrderValidation() throws Exception {
    // given
    SchemaMetadataInfo expected = schemaMetadataInfo1;
    // when
    TestResponse schemaMetadataInfo = createSchemaMetadataInfoFromQuery("/schemaregistry/schemas?name=plant&validationLevel=ALL&_orderByFields=timestamp,a", schemaRegistryTestServerClientWrapper, restClient);
    SchemaMetadataInfo actual = schemaMetadataInfo.getEnreplacedies().get(0);
    // then
    replacedert.replacedertThat(actual.getSchemaMetadata(), Is.is(expected.getSchemaMetadata()));
    replacedert.replacedertThat(actual.getId(), Is.is(expected.getId()));
}

See More Examples