Skip to content

Instantly share code, notes, and snippets.

View evonsdesigns's full-sized avatar
🌞

Joseph Evans evonsdesigns

🌞
View GitHub Profile
2019-05-20T14:29:04.126Z - info: server started on: http://WDXJE25760G5J:8081
2019-05-20T16:04:23.470Z - info: server response pid=35159, query_params={}, log=[], request_id=f044079e-1849-4db1-aab6-d474b61a1afe, event=response, timestamp=1558368263429, instance=http://WDXJE25760G5J:8081, labels=undefined, method=get, path=/, response_time=38, status_code=302, http_version=1.1, remote_address=127.0.0.1, user_agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36, referer=undefined, route=/, tags=undefined, config={}
2019-05-20T16:04:23.964Z - info: server response pid=35159, query_params={}, log=[request=1558368263472:WDXJE25760G5J:35159:jvwgtksu:10001, timestamp=1558368263960, tags=[auth, unauthenticated, response, platform], status_code=302, channel=internal], request_id=9d16c379-78b3-4dfa-8c0b-a1e5e6ca335d, event=response, timestamp=1558368263472, instance=http://WDXJE25760G5J:8081, labels=undefined, method=get, path=/login, response_t
PowerMockito.when(LoggerFactory.getLogger(any(Class.class)).thenReturn(logger);
package examples;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Test
public void testPojoMapper() {
PojoMapper pojoMapper = new PojoMapper();
ObjectMapper objectMapper = pojoMapper.getMapper();
assertTrue(
objectMapper.getDeserializationConfig().isEnabled(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES
)
);
assertTrue(
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
public class PojoMapper {
private ObjectMapper mapper;
public PojoMapper() {
mapper = new ObjectMapper();
mapper.configure(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,
@Test
public void testPojoMapper() {
PojoMapper pojoMapper = new PojoMapper();
ObjectMapper objectMapper = pojoMapper.getMapper();
assertTrue(
objectMapper.getDeserializationConfig().isEnabled(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES
)
);
}
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
public class PojoMapper {
private ObjectMapper mapper;
public PojoMapper() {
mapper = new ObjectMapper();
mapper.configure(
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,
true
[platform-work-answers] Full Error: {"data":{"@type":"Errors","errors":[{"@type":"Error","guid":"4c936746-8d37-4671-a1f7-e82699fee07e","message":"The provided value is not within the allowed range of this value","code":"validation
_constraint_rate_is_not_valid_value_range","field":"value","invalidValue":2.333333333333333e+43,"additionalInformations":[{"@type":"AdditionalInfo","name":"minValue","value":0},{"@type":"AdditionalInfo","name":"maxValue","value":99999}]},{"@type":"Error","guid":"b
981289b-2dc3-437f-94f8-0a65dac6e7fe","message":"The provided value has too many numbers after the decimal point","code":"validation_constraint_rate_has_too_many_decimal_places","field":"value","invalidValue":"2.333333333333333E43","additionalInformations":[{"@type
":"AdditionalInfo","name":"maxDecimalPoints","value":0}]}],"otherAttributes":{}},"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"PUT '/workAnswers/5f1ab2a7-2e4f-4789-b6e4-5ecde612e8c1' with re
import xhr from 'xhr';
const AVKEY = 'N77G40733L3SU8Z3';
const BASE_URL = 'https://www.alphavantage.co/query?function=SECTOR&apikey=';
export function getSectorsPerformance() {
return new Promise((resolve, reject) => {
xhr.get(BASE_URL + AVKEY, (err, resp, body) => {
if(err) {
reject(err);