target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void messageTest() { } | public Message message(String message) { this.message = message; return this; } | Message { public Message message(String message) { this.message = message; return this; } } | Message { public Message message(String message) { this.message = message; return this; } } | Message { public Message message(String message) { this.message = message; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotation.Nullable... | Message { public Message message(String message) { this.message = message; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotation.Nullable... |
@Test public void symbolIdExchangeTest() { } | public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } | PositionData { public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } } | PositionData { public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } } | PositionData { public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void... | PositionData { public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void... |
@Test public void symbolIdCoinapiTest() { } | public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } | PositionData { public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } } | PositionData { public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } } | PositionData { public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void set... | PositionData { public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void set... |
@Test public void avgEntryPriceTest() { } | public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } | PositionData { public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } } | PositionData { public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } } | PositionData { public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb... | PositionData { public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb... |
@Test public void typeTest() { } | public ValidationError type(String type) { this.type = type; return this; } | ValidationError { public ValidationError type(String type) { this.type = type; return this; } } | ValidationError { public ValidationError type(String type) { this.type = type; return this; } } | ValidationError { public ValidationError type(String type) { this.type = type; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title(Str... | ValidationError { public ValidationError type(String type) { this.type = type; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title(Str... |
@Test public void quantityTest() { } | public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } | PositionData { public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } } | PositionData { public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } } | PositionData { public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ... | PositionData { public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ... |
@Test public void sideTest() { } | public PositionData side(OrdSide side) { this.side = side; return this; } | PositionData { public PositionData side(OrdSide side) { this.side = side; return this; } } | PositionData { public PositionData side(OrdSide side) { this.side = side; return this; } } | PositionData { public PositionData side(OrdSide side) { this.side = side; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolIdExchange); ... | PositionData { public PositionData side(OrdSide side) { this.side = side; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolIdExchange); ... |
@Test public void unrealizedPnlTest() { } | public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } | PositionData { public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } } | PositionData { public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } } | PositionData { public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb... | PositionData { public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb... |
@Test public void leverageTest() { } | public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } | PositionData { public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } } | PositionData { public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } } | PositionData { public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ... | PositionData { public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ... |
@Test public void crossMarginTest() { } | public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } | PositionData { public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } } | PositionData { public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } } | PositionData { public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchang... | PositionData { public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchang... |
@Test public void liquidationPriceTest() { } | public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } | PositionData { public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } } | PositionData { public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } } | PositionData { public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); ... | PositionData { public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); ... |
@Test public void rawDataTest() { } | public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } | PositionData { public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } } | PositionData { public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } } | PositionData { public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolId... | PositionData { public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolId... |
@Test public void exchangeIdTest() { } | public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } | Position { public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } } | Position { public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } } | Position { public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExcha... | Position { public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExcha... |
@Test public void dataTest() { } | public Position data(List<PositionData> data) { this.data = data; return this; } | Position { public Position data(List<PositionData> data) { this.data = data; return this; } } | Position { public Position data(List<PositionData> data) { this.data = data; return this; } } | Position { public Position data(List<PositionData> data) { this.data = data; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExchangeId(String... | Position { public Position data(List<PositionData> data) { this.data = data; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExchangeId(String... |
@Test public void v1OrdersCancelAllPostTest() throws ApiException { OrderCancelAllRequest orderCancelAllRequest = null; Message response = api.v1OrdersCancelAllPost(orderCancelAllRequest); } | public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } | OrdersApi { public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } } | OrdersApi { public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); } | OrdersApi { public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void ... | OrdersApi { public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void ... |
@Test public void titleTest() { } | public ValidationError title(String title) { this.title = title; return this; } | ValidationError { public ValidationError title(String title) { this.title = title; return this; } } | ValidationError { public ValidationError title(String title) { this.title = title; return this; } } | ValidationError { public ValidationError title(String title) { this.title = title; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title... | ValidationError { public ValidationError title(String title) { this.title = title; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title... |
@Test public void v1OrdersCancelPostTest() throws ApiException { OrderCancelSingleRequest orderCancelSingleRequest = null; OrderExecutionReport response = api.v1OrdersCancelPost(orderCancelSingleRequest); } | public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } | OrdersApi { public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } } | OrdersApi { public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); } | OrdersApi { public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); Ap... | OrdersApi { public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); Ap... |
@Test public void v1OrdersGetTest() throws ApiException { String exchangeId = null; List<OrderExecutionReport> response = api.v1OrdersGet(exchangeId); } | public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } | OrdersApi { public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } } | OrdersApi { public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); } | OrdersApi { public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiCli... | OrdersApi { public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiCli... |
@Test public void v1OrdersPostTest() throws ApiException { OrderNewSingleRequest orderNewSingleRequest = null; OrderExecutionReport response = api.v1OrdersPost(orderNewSingleRequest); } | public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } | OrdersApi { public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } } | OrdersApi { public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); } | OrdersApi { public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(... | OrdersApi { public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(... |
@Test public void v1OrdersStatusClientOrderIdGetTest() throws ApiException { String clientOrderId = null; OrderExecutionReport response = api.v1OrdersStatusClientOrderIdGet(clientOrderId); } | public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } | OrdersApi { public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } } | OrdersApi { public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); } | OrdersApi { public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiCl... | OrdersApi { public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiCl... |
@Test public void v1BalancesGetTest() throws ApiException { String exchangeId = null; List<Balance> response = api.v1BalancesGet(exchangeId); } | public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } | BalancesApi { public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } } | BalancesApi { public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } BalancesApi(); BalancesApi(ApiClient apiClient); } | BalancesApi { public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } BalancesApi(); BalancesApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); ... | BalancesApi { public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } BalancesApi(); BalancesApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); ... |
@Test public void v1PositionsGetTest() throws ApiException { String exchangeId = null; List<Position> response = api.v1PositionsGet(exchangeId); } | public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } | PositionsApi { public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } } | PositionsApi { public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } PositionsApi(); PositionsApi(ApiClient apiClient); } | PositionsApi { public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } PositionsApi(); PositionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiCl... | PositionsApi { public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } PositionsApi(); PositionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiCl... |
@Test public void statusTest() { } | public ValidationError status(BigDecimal status) { this.status = status; return this; } | ValidationError { public ValidationError status(BigDecimal status) { this.status = status; return this; } } | ValidationError { public ValidationError status(BigDecimal status) { this.status = status; return this; } } | ValidationError { public ValidationError status(BigDecimal status) { this.status = status; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr... | ValidationError { public ValidationError status(BigDecimal status) { this.status = status; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr... |
@Test public void traceIdTest() { } | public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } | ValidationError { public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } } | ValidationError { public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } } | ValidationError { public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr... | ValidationError { public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr... |
@Test public void testBase() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("java"))))), "{\"java\":\"java\"}"); } | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testNoneRecipe() { RunListBuilder options = new RunListBuilder(); assertEquals(options.build(), ImmutableList.<String> of()); } | public List<String> build() { return ImmutableList.copyOf(list); } | RunListBuilder { public List<String> build() { return ImmutableList.copyOf(list); } } | RunListBuilder { public List<String> build() { return ImmutableList.copyOf(list); } } | RunListBuilder { public List<String> build() { return ImmutableList.copyOf(list); } RunListBuilder addRecipe(String recipe); RunListBuilder addRecipes(String... recipes); RunListBuilder addRole(String role); RunListBuilder addRoles(String... roles); List<String> build(); } | RunListBuilder { public List<String> build() { return ImmutableList.copyOf(list); } RunListBuilder addRecipe(String recipe); RunListBuilder addRecipes(String... recipes); RunListBuilder addRole(String role); RunListBuilder addRoles(String... roles); List<String> build(); } |
@Test public void test401DoesNotRetry() { HttpCommand command = createMock(HttpCommand.class); HttpResponse response = createMock(HttpResponse.class); BackoffLimitedRetryHandler retry = createMock(BackoffLimitedRetryHandler.class); expect(command.getFailureCount()).andReturn(0); expect(response.getStatusCode()).andRetu... | public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest().getEndpoint().getPath().indexOf("sandboxes") != -1) {... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... |
@Test public void test400DoesNotRetry() { HttpCommand command = createMock(HttpCommand.class); HttpResponse response = createMock(HttpResponse.class); BackoffLimitedRetryHandler retry = createMock(BackoffLimitedRetryHandler.class); expect(command.getFailureCount()).andReturn(0); expect(response.getStatusCode()).andRetu... | public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest().getEndpoint().getPath().indexOf("sandboxes") != -1) {... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... |
@Test public void testRetryOn400PutSandbox() { HttpCommand command = createMock(HttpCommand.class); BackoffLimitedRetryHandler retry = createMock(BackoffLimitedRetryHandler.class); HttpRequest request = HttpRequest.builder().method("PUT") .endpoint("https: .build(); HttpResponse response = HttpResponse .builder() .stat... | public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest().getEndpoint().getPath().indexOf("sandboxes") != -1) {... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... | ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(... |
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "runList must not be null") public void testBuildBootstrapConfigurationWithNullRunlist() { chefService.buildBootstrapConfiguration(null, null); } | @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.newHashMap(); bootstrapConfig.put("run_list"... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... |
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "jsonAttributes must not be null") public void testBuildBootstrapConfigurationWithNullJsonAttributes() { chefService.buildBootstrapConfiguration(ImmutableList.<String> of(), null); } | @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.newHashMap(); bootstrapConfig.put("run_list"... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... | BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new... |
@Test(expectedExceptions = IllegalStateException.class) public void testMustHaveValidatorName() { GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http: CacheLoader.from(Functions.forMap(ImmutableMap.<String, DatabagItem> of())), installChefGems, Optional.<String> absent(), validatorCredent... | public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(group); } catch (Exception e) { throw propagate(e); } String c... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... |
@Test(expectedExceptions = IllegalStateException.class) public void testMustHaveValidatorCredential() { GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http: CacheLoader.from(Functions.forMap(ImmutableMap.<String, DatabagItem> of())), installChefGems, validatorName, Optional.<PrivateKey> a... | public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(group); } catch (Exception e) { throw propagate(e); } String c... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... |
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Key 'foo' not present in map") public void testMustHaveRunScriptsName() { GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http: CacheLoader.from(Functions.forMap(ImmutableMap.<String, DatabagItem>... | public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(group); } catch (Exception e) { throw propagate(e); } String c... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... |
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "null value in entry: foo=null") public void testMustHaveRunScriptsValue() { GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http: CacheLoader.from(Functions.forMap(ImmutableMap.<String, DatabagItem> o... | public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(group); } catch (Exception e) { throw propagate(e); } String c... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... | GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro... |
@Test(expectedExceptions = IllegalArgumentException.class) public void testIllegal() { json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("java")), "java/system", Suppliers.ofInstance(new JsonBall("system"))))); } | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testApplyInputStreamDetails() throws UnknownHostException { InputStream is = Strings2 .toInputStream("{\"error\":[\"invalid tarball: tarball root must contain java-bytearray\"]}"); ParseErrorFromJsonOrReturnBody parser = new ParseErrorFromJsonOrReturnBody(new ReturnStringIf2xx()); String response = pa... | @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } | ParseErrorFromJsonOrReturnBody implements Function<HttpResponse, String> { @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } } | ParseErrorFromJsonOrReturnBody implements Function<HttpResponse, String> { @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } @Inject ParseErrorFromJsonOrReturnBody(ReturnStringIf2xx returnStringIf200); } | ParseErrorFromJsonOrReturnBody implements Function<HttpResponse, String> { @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } @Inject ParseErrorFromJsonOrReturnBody(ReturnStringIf2xx returnStringIf200); @... | ParseErrorFromJsonOrReturnBody implements Function<HttpResponse, String> { @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } @Inject ParseErrorFromJsonOrReturnBody(ReturnStringIf2xx returnStringIf200); @... |
@Test(expectedExceptions = NullPointerException.class) public void testWithNullInput() { Function<Object, URI> function = new UriForResource(); function.apply(null); } | @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } |
@Test(expectedExceptions = IllegalArgumentException.class) public void testWithInvalidInput() { Function<Object, URI> function = new UriForResource(); function.apply(new Object()); } | @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } |
@Test public void testWithValidResource() { Function<Object, URI> function = new UriForResource(); Resource res = new Resource("test", URI.create("http: URI result = function.apply(res); assertEquals(res.getUrl().toString(), result.toString()); } | @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } | UriForResource implements Function<Object, URI> { @Override public URI apply(Object input) { checkArgument(checkNotNull(input, "input") instanceof Resource, "This function can only be applied to Resource objects"); return ((Resource) input).getUrl(); } @Override URI apply(Object input); } |
@Test(expectedExceptions = IllegalStateException.class) public void testWhenNoDatabagItem() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Client client = createMock(Client.class); BootstrapConfigForGroup fn = new BootstrapConfigForGroup("jclouds", chefApi); expect(chefApi.getDatabagItem("jclouds", "... | @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } } | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... |
@Test public void testReturnsItem() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Api api = createMock(Api.class); BootstrapConfigForGroup fn = new BootstrapConfigForGroup("jclouds", chefApi); DatabagItem config = new DatabagItem("foo", "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache... | @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } } | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... | BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG... |
@Test(expectedExceptions = IllegalStateException.class) public void testWhenNoDatabagItem() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Client client = createMock(Client.class); RunListForGroup fn = new RunListForGroup(new BootstrapConfigForGroup("jclouds", chefApi), json); expect(chefApi.getDatab... | @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = config.get("run_list"); return json.fromJson(runlist.toString(... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... |
@Test public void testReadRunList() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Api api = createMock(Api.class); RunListForGroup fn = new RunListForGroup(new BootstrapConfigForGroup("jclouds", chefApi), json); DatabagItem config = new DatabagItem("foo", "{\"tomcat6\":{\"ssl_port\":8433},\"run_list... | @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = config.get("run_list"); return json.fromJson(runlist.toString(... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... | RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co... |
@Test void canonicalizedPathRemovesMultipleSlashes() { assertEquals(signing_obj.canonicalPath(" } | @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } } | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... |
@Test void canonicalizedPathRemovesTrailingSlash() { assertEquals(signing_obj.canonicalPath("/path/"), "/path"); } | @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } } | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... | SignedHeaderAuth implements HttpRequestFilter { @VisibleForTesting String canonicalPath(String path) { path = path.replaceAll("\\/+", "/"); return path.endsWith("/") && path.length() > 1 ? path.substring(0, path.length() - 1) : path; } @Inject SignedHeaderAuth(SignatureWire signatureWire, @org.jclouds.location.Provide... |
@Test public void testOne() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("{\"time\":\"time\"}")), "java/system", Suppliers.ofInstance(new JsonBall("system"))))), "{\"java\":{\"system\":\"system\",\"time\":\"time\"}}"); } | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test void shouldGenerateTheCorrectStringToSignAndSignatureWithNoBody() { HttpRequest request = HttpRequest.builder().method(HttpMethod.DELETE).endpoint("http: .build(); request = signing_obj.filter(request); Multimap<String, String> headersWithoutContentLength = LinkedHashMultimap.create(request.getHeaders()); assertE... | public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayListMultimap.create(); headers.put("X-Ops-Content... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... |
@Test void shouldNotChokeWhenSigningARequestForAResourceWithALongName() { StringBuilder path = new StringBuilder("nodes/"); for (int i = 0; i < 100; i++) path.append('A'); HttpRequest request = HttpRequest.builder().method(HttpMethod.PUT) .endpoint("http: signing_obj.filter(request); } | public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayListMultimap.create(); headers.put("X-Ops-Content... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... |
@Test void shouldReplacePercentage3FWithQuestionMarkAtUrl() { StringBuilder path = new StringBuilder("nodes/"); path.append("test/cookbooks/myCookBook%3Fnum_versions=5"); HttpRequest request = HttpRequest.builder().method(HttpMethod.GET) .endpoint("http: request = signing_obj.filter(request); assertTrue(request.getRequ... | public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayListMultimap.create(); headers.put("X-Ops-Content... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... | SignedHeaderAuth implements HttpRequestFilter { public HttpRequest filter(HttpRequest input) throws HttpException { HttpRequest request = input.toBuilder().endpoint(input.getEndpoint().toString().replace("%3F", "?")).build(); String contentHash = hashBody(request.getPayload()); Multimap<String, String> headers = ArrayL... |
@Test(expectedExceptions = NullPointerException.class) public void testInvalidNullInput() { HttpRequest request = HttpRequest.builder().method("POST").endpoint(URI.create("http: binder.bindToRequest(request, null); } | @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((Group) payload); return super.bindToRequest(request, updateGroup... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... |
@Test(expectedExceptions = IllegalArgumentException.class) public void testInvalidTypeInput() { HttpRequest request = HttpRequest.builder().method("POST").endpoint(URI.create("http: binder.bindToRequest(request, new Object()); } | @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((Group) payload); return super.bindToRequest(request, updateGroup... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... | BindGroupToUpdateRequestJsonPayload extends BindToJsonPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { checkArgument(checkNotNull(payload, "payload") instanceof Group, "this binder is only valid for Group objects"); GroupUpdateRequest updateGroup = new GroupUpdateRequest((... |
@Test(expectedExceptions = NullPointerException.class) public void testInvalidNullInput() { BindGroupNameToJsonPayload binder = new BindGroupNameToJsonPayload(); HttpRequest request = HttpRequest.builder().method("POST").endpoint(URI.create("http: binder.bindToRequest(request, null); } | @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { super.bindToRequest(request, String.format("{\"groupname\":\"%s\"}", checkNotNull(payload, "payload"))); request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON); return request; } | BindGroupNameToJsonPayload extends BindToStringPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { super.bindToRequest(request, String.format("{\"groupname\":\"%s\"}", checkNotNull(payload, "payload"))); request.getPayload().getContentMetadata().setContentType(MediaType.APPLI... | BindGroupNameToJsonPayload extends BindToStringPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { super.bindToRequest(request, String.format("{\"groupname\":\"%s\"}", checkNotNull(payload, "payload"))); request.getPayload().getContentMetadata().setContentType(MediaType.APPLI... | BindGroupNameToJsonPayload extends BindToStringPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { super.bindToRequest(request, String.format("{\"groupname\":\"%s\"}", checkNotNull(payload, "payload"))); request.getPayload().getContentMetadata().setContentType(MediaType.APPLI... | BindGroupNameToJsonPayload extends BindToStringPayload { @Override public <R extends HttpRequest> R bindToRequest(R request, Object payload) { super.bindToRequest(request, String.format("{\"groupname\":\"%s\"}", checkNotNull(payload, "payload"))); request.getPayload().getContentMetadata().setContentType(MediaType.APPLI... |
@Test(expectedExceptions = NullPointerException.class) public void testInvalidNullInput() { new GroupName().apply(null); } | @Override public String apply(Object from) { return ((Group) checkNotNull(from, "from")).getGroupname(); } | GroupName implements Function<Object, String> { @Override public String apply(Object from) { return ((Group) checkNotNull(from, "from")).getGroupname(); } } | GroupName implements Function<Object, String> { @Override public String apply(Object from) { return ((Group) checkNotNull(from, "from")).getGroupname(); } } | GroupName implements Function<Object, String> { @Override public String apply(Object from) { return ((Group) checkNotNull(from, "from")).getGroupname(); } @Override String apply(Object from); } | GroupName implements Function<Object, String> { @Override public String apply(Object from) { return ((Group) checkNotNull(from, "from")).getGroupname(); } @Override String apply(Object from); } |
@Test public void testOneDuplicate() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("{\"time\":\"time\"}")), "java", Suppliers.ofInstance(new JsonBall("{\"system\":\"system\"}"))))), "{\"java\":{\"system\":\"system\",\"time\":\"tim... | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testMerge() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":\"hello\"}}")), "java/time", Suppliers.ofInstance(new JsonBall("{\"2\":\"goodbye\"}"))))), "{\"java\":{\"time\":{\"2\":\"goodbye\",\"1\"... | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testMergeNestedTwice() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":\"hello\"}}")), "java", Suppliers.ofInstance(new JsonBall("{\"time\":{\"2\":\"goodbye\"}}"))))), "{\"java\":{\"time\":{\"2\":... | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testReplaceList() { assertEquals( json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java", Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":[\"hello\"]}}")), "java/time", Suppliers.ofInstance(new JsonBall("{\"1\":[\"goodbye\"]}"))))), "{\"java\":{\"time\":{\"1\":[\"good... | @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKeys(autoAttrs, new Predicate<String>() { @Override public boolean apply(String input) { return inpu... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... | NestSlashKeys implements Function<Multimap<String, Supplier<JsonBall>>, Map<String, JsonBall>> { @Override public Map<String, JsonBall> apply(Multimap<String, Supplier<JsonBall>> from) { Map<String, JsonBall> autoAttrs = mergeSameKeys(from); Map<String, JsonBall> modifiableFlatMap = Maps.newLinkedHashMap(Maps.filterKey... |
@Test public void testWithNoRunlist() { ChefApi chef = createMock(ChefApi.class); Map<String, JsonBall> automatic = ImmutableMap.<String, JsonBall> of(); Node node = new Node("name", ImmutableSet.<String> of(), "_default"); Supplier<Map<String, JsonBall>> automaticSupplier = Suppliers.<Map<String, JsonBall>> ofInstance... | @Override public Node execute(Node node) { logger.trace("creating node %s", node.getName()); node.getAutomatic().putAll(automaticSupplier.get()); chef.createNode(node); logger.debug("created node %s", node.getName()); return node; } | CreateNodeAndPopulateAutomaticAttributesImpl implements CreateNodeAndPopulateAutomaticAttributes { @Override public Node execute(Node node) { logger.trace("creating node %s", node.getName()); node.getAutomatic().putAll(automaticSupplier.get()); chef.createNode(node); logger.debug("created node %s", node.getName()); ret... | CreateNodeAndPopulateAutomaticAttributesImpl implements CreateNodeAndPopulateAutomaticAttributes { @Override public Node execute(Node node) { logger.trace("creating node %s", node.getName()); node.getAutomatic().putAll(automaticSupplier.get()); chef.createNode(node); logger.debug("created node %s", node.getName()); ret... | CreateNodeAndPopulateAutomaticAttributesImpl implements CreateNodeAndPopulateAutomaticAttributes { @Override public Node execute(Node node) { logger.trace("creating node %s", node.getName()); node.getAutomatic().putAll(automaticSupplier.get()); chef.createNode(node); logger.debug("created node %s", node.getName()); ret... | CreateNodeAndPopulateAutomaticAttributesImpl implements CreateNodeAndPopulateAutomaticAttributes { @Override public Node execute(Node node) { logger.trace("creating node %s", node.getName()); node.getAutomatic().putAll(automaticSupplier.get()); chef.createNode(node); logger.debug("created node %s", node.getName()); ret... |
@Test public void test() { ChefApi chef = createMock(ChefApi.class); Map<String, JsonBall> automatic = ImmutableMap.<String, JsonBall> of(); Node node = new Node("name", ImmutableSet.<String> of(), "_default"); Supplier<Map<String, JsonBall>> automaticSupplier = Suppliers.<Map<String, JsonBall>> ofInstance(automatic); ... | @Override public void execute(String nodeName) { logger.trace("updating node %s", nodeName); Node node = chef.getNode(nodeName); Node mutable = new Node(node.getName(), node.getNormal(), node.getOverride(), node.getDefault(), automaticSupplier.get(), node.getRunList(), node.getChefEnvironment()); chef.updateNode(mutabl... | UpdateAutomaticAttributesOnNodeImpl implements UpdateAutomaticAttributesOnNode { @Override public void execute(String nodeName) { logger.trace("updating node %s", nodeName); Node node = chef.getNode(nodeName); Node mutable = new Node(node.getName(), node.getNormal(), node.getOverride(), node.getDefault(), automaticSupp... | UpdateAutomaticAttributesOnNodeImpl implements UpdateAutomaticAttributesOnNode { @Override public void execute(String nodeName) { logger.trace("updating node %s", nodeName); Node node = chef.getNode(nodeName); Node mutable = new Node(node.getName(), node.getNormal(), node.getOverride(), node.getDefault(), automaticSupp... | UpdateAutomaticAttributesOnNodeImpl implements UpdateAutomaticAttributesOnNode { @Override public void execute(String nodeName) { logger.trace("updating node %s", nodeName); Node node = chef.getNode(nodeName); Node mutable = new Node(node.getName(), node.getNormal(), node.getOverride(), node.getDefault(), automaticSupp... | UpdateAutomaticAttributesOnNodeImpl implements UpdateAutomaticAttributesOnNode { @Override public void execute(String nodeName) { logger.trace("updating node %s", nodeName); Node node = chef.getNode(nodeName); Node mutable = new Node(node.getName(), node.getNormal(), node.getOverride(), node.getDefault(), automaticSupp... |
@Test(expectedExceptions = NoSuchElementException.class) public void testFindRoleInRunListThrowsNoSuchElementOnRecipe() { ChefUtils.findRoleInRunList(ImmutableList.of("recipe[java]")); } | public static String findRoleInRunList(List<String> runList) { final Pattern pattern = Pattern.compile("^role\\[(.*)\\]$"); String roleToParse = Iterables.find(runList, new Predicate<String>() { @Override public boolean apply(String input) { return pattern.matcher(input).matches(); } }); Matcher matcher = pattern.match... | ChefUtils { public static String findRoleInRunList(List<String> runList) { final Pattern pattern = Pattern.compile("^role\\[(.*)\\]$"); String roleToParse = Iterables.find(runList, new Predicate<String>() { @Override public boolean apply(String input) { return pattern.matcher(input).matches(); } }); Matcher matcher = p... | ChefUtils { public static String findRoleInRunList(List<String> runList) { final Pattern pattern = Pattern.compile("^role\\[(.*)\\]$"); String roleToParse = Iterables.find(runList, new Predicate<String>() { @Override public boolean apply(String input) { return pattern.matcher(input).matches(); } }); Matcher matcher = p... | ChefUtils { public static String findRoleInRunList(List<String> runList) { final Pattern pattern = Pattern.compile("^role\\[(.*)\\]$"); String roleToParse = Iterables.find(runList, new Predicate<String>() { @Override public boolean apply(String input) { return pattern.matcher(input).matches(); } }); Matcher matcher = p... | ChefUtils { public static String findRoleInRunList(List<String> runList) { final Pattern pattern = Pattern.compile("^role\\[(.*)\\]$"); String roleToParse = Iterables.find(runList, new Predicate<String>() { @Override public boolean apply(String input) { return pattern.matcher(input).matches(); } }); Matcher matcher = p... |
@Test public void extension_createContext_returnsContext() { PowerMockito.mockStatic(LocalNotificationsContext.class); when(LocalNotificationsContext.getInstance()).thenReturn(context); assertSame(context, getSubject().createContext("anyId")); } | @Override public FREContext createContext(String extId) { Logger.log("Create Context"); return LocalNotificationsContext.getInstance(); } | Extension implements FREExtension { @Override public FREContext createContext(String extId) { Logger.log("Create Context"); return LocalNotificationsContext.getInstance(); } } | Extension implements FREExtension { @Override public FREContext createContext(String extId) { Logger.log("Create Context"); return LocalNotificationsContext.getInstance(); } } | Extension implements FREExtension { @Override public FREContext createContext(String extId) { Logger.log("Create Context"); return LocalNotificationsContext.getInstance(); } @Override FREContext createContext(String extId); @Override void initialize(); @Override void dispose(); } | Extension implements FREExtension { @Override public FREContext createContext(String extId) { Logger.log("Create Context"); return LocalNotificationsContext.getInstance(); } @Override FREContext createContext(String extId); @Override void initialize(); @Override void dispose(); } |
@Test public void settings_getSoundUri_returnsNullIfBundleDoesNotPlaySoundAndDoesNotHaveSoundName() { assertNull(getSubject().getSoundUri()); } | public Uri getSoundUri() { String soundName = getSoundName(); if (soundName == null) return null; return NotificationSoundProvider.getSoundUri(soundName); } | SoundSettings { public Uri getSoundUri() { String soundName = getSoundName(); if (soundName == null) return null; return NotificationSoundProvider.getSoundUri(soundName); } } | SoundSettings { public Uri getSoundUri() { String soundName = getSoundName(); if (soundName == null) return null; return NotificationSoundProvider.getSoundUri(soundName); } SoundSettings(Bundle bundle); } | SoundSettings { public Uri getSoundUri() { String soundName = getSoundName(); if (soundName == null) return null; return NotificationSoundProvider.getSoundUri(soundName); } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } | SoundSettings { public Uri getSoundUri() { String soundName = getSoundName(); if (soundName == null) return null; return NotificationSoundProvider.getSoundUri(soundName); } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } |
@Test public void settings_getSoundDefault_returnsZeroIfBundlePlaysSoundAndDoesNotHaveSoundName() { when(bundle.getBoolean(Constants.PLAY_SOUND)).thenReturn(true); assertEquals(Notification.DEFAULT_SOUND, getSubject().getSoundDefault()); } | public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } |
@Test public void settings_getSoundDefault_returnsZeroIfBundlePlaysSoundAndHasSoundName() { when(bundle.getString(Constants.SOUND_NAME)).thenReturn("sound.mp3"); when(bundle.getBoolean(Constants.PLAY_SOUND)).thenReturn(true); assertEquals(0, getSubject().getSoundDefault()); } | public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } |
@Test public void settings_getSoundDefault_returnsZeroIfBundleDoesNotPlaySoundAndHasSoundName() { when(bundle.getString(Constants.SOUND_NAME)).thenReturn("sound.mp3"); when(bundle.getBoolean(Constants.PLAY_SOUND)).thenReturn(false); assertEquals(0, getSubject().getSoundDefault()); } | public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } |
@Test public void settings_getSoundDefault_returnsZeroIfBundleDoesNotPlaySoundAndDoesNotHaveSoundName() { assertEquals(0, getSubject().getSoundDefault()); } | public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } | SoundSettings { public int getSoundDefault() { return shouldPlayDefaultSound()? Notification.DEFAULT_SOUND : 0; } SoundSettings(Bundle bundle); Uri getSoundUri(); int getSoundDefault(); } |
@Test public void application_addsCallbacks_onCreate() { getSubject().onCreate(); verify(getSubject()).registerActivityLifecycleCallbacks(callbacks); } | @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new LifecycleCallbacks()); } | Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new LifecycleCallbacks()); } } | Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new LifecycleCallbacks()); } } | Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new LifecycleCallbacks()); } @Override void onCreate(); } | Application extends android.app.Application { @Override public void onCreate() { super.onCreate(); registerActivityLifecycleCallbacks(new LifecycleCallbacks()); } @Override void onCreate(); } |
@Test public void intentService_onHandleIntent_doesNotDispatchNotificationWhenUserResponseNotPresent() { try { PowerMockito.whenNew(LocalNotificationEventDispatcher.class) .withArguments("KeyCode", data, "ActionId", null) .thenReturn(dispatcher); } catch(Exception e) { e.printStackTrace(); } when(intent.getStringExtra(... | @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logStatus(intent); Logger.log("Background mode: " + backgrou... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... |
@Test public void notification_deserialize_deserializesFromJsonObject() { when(jsonObject.optString("code", "")).thenReturn("MyCode"); when(jsonObject.optString("tickerText", "")).thenReturn("Ticker"); when(jsonObject.optString("title", "")).thenReturn("Title"); when(jsonObject.optString("body", "")).thenReturn("Body")... | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesPlaySoundFromJsonObject() { when(jsonObject.optBoolean("playSound", false)).thenReturn(true); assertEquals(false, getSubject().playSound); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().playSound); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesVibrateFromJsonObject() { when(jsonObject.optBoolean("vibrate", false)).thenReturn(true); assertEquals(false, getSubject().vibrate); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().vibrate); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesCancelOnSelectFromJsonObject() { when(jsonObject.optBoolean("cancelOnSelect", false)).thenReturn(true); assertEquals(false, getSubject().cancelOnSelect); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().cancelOnSelect); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesOngoingFromJsonObject() { when(jsonObject.optBoolean("ongoing", false)).thenReturn(true); assertEquals(false, getSubject().ongoing); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().ongoing); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesHasActionFromJsonObject() { when(jsonObject.optBoolean("hasAction", false)).thenReturn(true); assertEquals(false, getSubject().hasAction); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().hasAction); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesShowInForegroundFromJsonObject() { when(jsonObject.optBoolean("showInForeground", false)).thenReturn(true); assertEquals(false, getSubject().showInForeground); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().showInForeground); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesByteDataFromJsonObject() { try { when(jsonObject.getJSONArray("actionData")).thenReturn(jsonArray); when(jsonArray.length()).thenReturn(2); when(jsonArray.getInt(0)).thenReturn(101); when(jsonArray.getInt(1)).thenReturn(30); } catch (Throwable e) { e.printStackTrac... | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_deserializesIsExactFromJsonObject() { when(jsonObject.optBoolean("isExact", false)).thenReturn(true); assertEquals(false, getSubject().isExact); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().isExact); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void intentService_onHandleIntent_closesDialogs() { getSubject().onHandleIntent(intent); verify(getSubject()).sendBroadcast(closeIntent); } | @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logStatus(intent); Logger.log("Background mode: " + backgrou... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... |
@Test public void notification_deserialize_deserializesAllowWhileIdleFromJsonObject() { when(jsonObject.optBoolean("allowWhileIdle", false)).thenReturn(true); assertEquals(false, getSubject().allowWhileIdle); getSubject().deserialize(jsonObject); assertEquals(true, getSubject().allowWhileIdle); } | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_doesNothingIfJsonObjectIsNull() { getSubject().deserialize(null); verify(jsonObject, never()).optString(eq("code"), anyString()); verify(jsonObject, never()).optString(eq("tickerText"), anyString()); verify(jsonObject, never()).optString(eq("title"), anyString()); verify(jsonO... | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_deserialize_stopsDeserializingByteArrayIfAnExceptionIsThrown() { try { when(jsonObject.getJSONArray("actionData")).thenReturn(jsonArray); when(jsonArray.length()).thenReturn(2); when(jsonArray.getInt(0)).thenReturn(101); when(jsonArray.getInt(1)).thenThrow(mock(JSONException.class)); getS... | public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body", body); playSound = jsonObject.optBoolean("playSound", playS... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... | LocalNotification implements ISerializable, IDeserializable { public void deserialize(JSONObject jsonObject) { if (jsonObject != null) { code = jsonObject.optString("code", code); tickerText = jsonObject.optString("tickerText", tickerText); title = jsonObject.optString("title", title); body = jsonObject.optString("body... |
@Test public void notification_serialize_serializesNotification() { try { assertSame(jsonObject, getSubject("MyCode").serialize()); verify(jsonObject).putOpt("code", "MyCode"); verify(jsonObject).putOpt("tickerText", "Ticker2"); verify(jsonObject).putOpt("title", "Title2"); verify(jsonObject).putOpt("body", "Body2"); v... | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesPlaySound() { try { getSubject().playSound = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("playSound", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesVibrate() { try { getSubject().vibrate = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("vibrate", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesCancelOnSelect() { try { getSubject().cancelOnSelect = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("cancelOnSelect", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesOngoing() { try { getSubject().ongoing = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("ongoing", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesHasAction() { try { getSubject().hasAction = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("hasAction", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesShowInForeground() { try { getSubject().showInForeground = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("showInForeground", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void intentService_onHandleIntent_triesToDispatchEventToBackground() { getSubject().onHandleIntent(intent); verify(dispatcher).dispatchWhenActive(); } | @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logStatus(intent); Logger.log("Background mode: " + backgrou... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... | LocalNotificationIntentService extends IntentService { @Override public final void onHandleIntent(Intent intent) { boolean backgroundMode = intent.getBooleanExtra(Constants.BACKGROUND_MODE_KEY, false); sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); tryEventDispatch(intent); handleResponse(intent); logSt... |
@Test public void notification_serialize_serializesByteData() { try { getSubject().actionData = new byte[]{102, 127}; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).accumulate("actionData", 102); verify(jsonObject).accumulate("actionData", 127); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesIsExact() { try { getSubject().isExact = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("isExact", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_serializesAllowWhileIdle() { try { getSubject().allowWhileIdle = true; assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).putOpt("allowWhileIdle", true); } catch (JSONException e) { e.printStackTrace(); } } | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_serialize_stopsSerializingDataIfAnExceptionIsThrown() { try { getSubject().actionData = new byte[]{102, 127}; when(jsonObject.accumulate("actionData", 102)).thenThrow(mock(JSONException.class)); assertSame(jsonObject, getSubject().serialize()); verify(jsonObject).accumulate("actionData", ... | public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", playSound); jsonObject.putOpt("vibrate", vibrate); jsonObject.p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... | LocalNotification implements ISerializable, IDeserializable { public JSONObject serialize() { JSONObject jsonObject = new JSONObject(); try { jsonObject.putOpt("code", code); jsonObject.putOpt("tickerText", tickerText); jsonObject.putOpt("title", title); jsonObject.putOpt("body", body); jsonObject.putOpt("playSound", p... |
@Test public void notification_getRepeatIntervalMilliseconds_returnsTimeInMilliseconds() { LocalNotificationTimeInterval intervalMock = mock(LocalNotificationTimeInterval.class); try { PowerMockito.whenNew(LocalNotificationTimeInterval.class) .withArguments(10) .thenReturn(intervalMock); } catch (Throwable e) { e.print... | @SuppressWarnings("WeakerAccess") public long getRepeatIntervalMilliseconds() { return new LocalNotificationTimeInterval(repeatInterval) .toMilliseconds(); } | LocalNotification implements ISerializable, IDeserializable { @SuppressWarnings("WeakerAccess") public long getRepeatIntervalMilliseconds() { return new LocalNotificationTimeInterval(repeatInterval) .toMilliseconds(); } } | LocalNotification implements ISerializable, IDeserializable { @SuppressWarnings("WeakerAccess") public long getRepeatIntervalMilliseconds() { return new LocalNotificationTimeInterval(repeatInterval) .toMilliseconds(); } LocalNotification(); LocalNotification(String activityClassName); } | LocalNotification implements ISerializable, IDeserializable { @SuppressWarnings("WeakerAccess") public long getRepeatIntervalMilliseconds() { return new LocalNotificationTimeInterval(repeatInterval) .toMilliseconds(); } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess")... | LocalNotification implements ISerializable, IDeserializable { @SuppressWarnings("WeakerAccess") public long getRepeatIntervalMilliseconds() { return new LocalNotificationTimeInterval(repeatInterval) .toMilliseconds(); } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess")... |
@Test public void notification_repeatsRecurrently_returnsTrueIfHasRepeatInterval_afterKitKat() { Whitebox.setInternalState(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.KITKAT); getSubject().repeatInterval = 10; getSubject().isExact = false; assertTrue(getSubject().repeatsRecurrently()); } | public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... |
@Test public void notification_repeatsRecurrently_returnsTrueIfHasRepeatIntervalAndIsExact() { Whitebox.setInternalState(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.KITKAT - 1); getSubject().repeatInterval = 10; getSubject().isExact = true; assertTrue(getSubject().repeatsRecurrently()); } | public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... |
@Test public void notification_repeatsRecurrently_returnsFalseIfDoesNotHaveRepeatInterval() { Whitebox.setInternalState(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.KITKAT); getSubject().repeatInterval = 0; getSubject().isExact = true; assertFalse(getSubject().repeatsRecurrently()); } | public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... |
@Test public void notification_repeatsRecurrently_returnsFalseIfNonExact_beforeKitKat() { Whitebox.setInternalState(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.KITKAT - 1); getSubject().repeatInterval = 10; getSubject().isExact = false; assertFalse(getSubject().repeatsRecurrently()); } | public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); } | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... | LocalNotification implements ISerializable, IDeserializable { public boolean repeatsRecurrently() { return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || isExact) && repeatInterval != 0; } LocalNotification(); LocalNotification(String activityClassName); @SuppressWarnings("WeakerAccess") long getRepeatInterva... |
@Test public void context_dispatchNotificationSelectedEvent_dispatchesEvent() { getSubject().dispatchNotificationSelectedEvent(); verify(getSubject()).dispatchStatusEventAsync("notificationSelected", "status"); } | void dispatchNotificationSelectedEvent() { LocalNotificationCache.getInstance().reset(); dispatchStatusEventAsync(NOTIFICATION_SELECTED, STATUS); } | LocalNotificationsContext extends FREContext { void dispatchNotificationSelectedEvent() { LocalNotificationCache.getInstance().reset(); dispatchStatusEventAsync(NOTIFICATION_SELECTED, STATUS); } } | LocalNotificationsContext extends FREContext { void dispatchNotificationSelectedEvent() { LocalNotificationCache.getInstance().reset(); dispatchStatusEventAsync(NOTIFICATION_SELECTED, STATUS); } } | LocalNotificationsContext extends FREContext { void dispatchNotificationSelectedEvent() { LocalNotificationCache.getInstance().reset(); dispatchStatusEventAsync(NOTIFICATION_SELECTED, STATUS); } @Override void dispose(); @Override Map<String, FREFunction> getFunctions(); } | LocalNotificationsContext extends FREContext { void dispatchNotificationSelectedEvent() { LocalNotificationCache.getInstance().reset(); dispatchStatusEventAsync(NOTIFICATION_SELECTED, STATUS); } @Override void dispose(); @Override Map<String, FREFunction> getFunctions(); static final public String NOTIFICATION_SELECTE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.