Skip to content

Commit

Permalink
[*] tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-karpovich committed Aug 29, 2023
1 parent ad71d9d commit e0715c2
Show file tree
Hide file tree
Showing 74 changed files with 1,923 additions and 9,334 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Mon Jul 19 08:25:17 UTC 2021
version=1.0.6-SNAPSHOT
version=1.1.1-SNAPSHOT
systemProp.file.encoding=utf-8
timebaseVersion=6.1.17
commonsVersion=6.0.64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.epam.deltix.tbwg.webapp.controllers;

import com.epam.deltix.tbwg.webapp.model.smd.CurrencyDef;
import com.epam.deltix.timebase.messages.IdentityKey;
import com.epam.deltix.timebase.messages.InstrumentKey;
import com.epam.deltix.timebase.messages.InstrumentMessage;
Expand Down Expand Up @@ -1183,6 +1184,18 @@ public ResponseEntity<SchemaDef> getSchema(@RequestParam String key) {
return ResponseEntity.ok(schemaManipulationService.getSchema(key));
}


@PreAuthorize("hasAnyAuthority('TB_ALLOW_READ', 'TB_ALLOW_WRITE')")
@RequestMapping(value = "/currencies", method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<CurrencyDef[]> currencies() {

LOGGER.log(LogLevel.INFO, "GET CURRENCIES() ");

ArrayList<CurrencyDef> currencies = new ArrayList<CurrencyDef>();

return ResponseEntity.ok(currencies.toArray(new CurrencyDef[currencies.size()]));
}

@PreAuthorize("hasAnyAuthority('TB_ALLOW_READ', 'TB_ALLOW_WRITE')")
@RequestMapping(value = "/instruments/{id}/info", method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<InstrumentDef> instruments(@PathVariable String id, @RequestParam(required = false) String[] hiddenExchanges) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ public LinesQueryResult build(ReactiveMessageSource source) {
query.getStream() + "[" + query.getSymbol() + "]", source, query.getInterval()
);

if (source == null)
System.out.println("Source is null");

Observable<?> inputObservable = source.getMessageSource()
.takeWhile(x -> x.getTimeStampMs() <= endTime);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Scanner;
import java.util.Set;

import static com.epam.deltix.tbwg.webapp.utils.BordersTimeBarChartsUtils.*;
import static org.mockito.ArgumentMatchers.any;
Expand Down Expand Up @@ -133,7 +134,8 @@ public void setUp(long pointInterval, Instant startTime, Instant endTime, Messag

ReactiveMessageSource reactiveMessageSource = new ReactiveMessageSourceImpl(messageProducer.run(), messageProducer.getObservable());
Mockito.when(messageSourceFactory.buildSource(any(), any(), anyBoolean(), anyBoolean())).thenReturn(reactiveMessageSource);
//Mockito.when(messageSourceFactory.buildSource(any(), any(), any(), any(), anyBoolean())).thenReturn(reactiveMessageSource);
Mockito.when(messageSourceFactory.buildSource(any(), any(), (Set<String>)any(), any(), anyBoolean(), anyBoolean())).thenReturn(reactiveMessageSource);
//Mockito.when(messageSourceFactory.buildSource(any(), any(), any(), (TimeInterval) any(), anyBoolean(), anyBoolean())).thenReturn(reactiveMessageSource);
}

public long runTestFullResponseCheck(long pointInterval, Instant startTime, Instant endTime, String resultFilename,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ server:
enabled: true
mime-types: text/html,text/css,application/javascript,application/json
timebase:
url: dxtick://localhost:5453
url: dxtick://tb-server:8011
user:
password:
streams:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "37",
"low": "35.55",
"high": "41.96",
"volume": "81913"
"volume": "81913",
"exchange":"null"
},
{
"time": 1640995200000,
"open": "36.26",
"close": "42.7",
"low": "32.3",
"high": "44.24",
"volume": "159312"
"volume": "159312",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "23.86",
"low": "21.02",
"high": "24.7",
"volume": "355594467"
"volume": "355594467",
"exchange":"null"
},
{
"time": 1618790400000,
"open": "24.46",
"close": "22.03",
"low": "21.66",
"high": "24.85",
"volume": "308722117"
"volume": "308722117",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2021-04-19T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"close": "42.7",
"low": "32.3",
"high": "44.24",
"volume": "241225"
"volume": "241225",
"exchange":"null"
}
]
}
Expand All @@ -22,4 +23,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "44.7",
"low": "27.4026",
"high": "48.3073",
"volume": "2231659"
"volume": "2231659",
"exchange":"null"
},
{
"time": 1633046400000,
"open": "44.7",
"close": "33.505",
"low": "32.98",
"high": "46.59",
"volume": "1537484"
"volume": "1537484",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2021-10-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"close": "43.97",
"low": "29.5",
"high": "48.3073",
"volume": "2587684"
"volume": "2587684",
"exchange":"null"
}
]
}
Expand All @@ -22,4 +23,4 @@
"end": "2021-07-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"close": "33.505",
"low": "32.98",
"high": "48.3073",
"volume": "2758023"
"volume": "2758023",
"exchange":"null"
}
]
}
Expand All @@ -22,4 +23,4 @@
"end": "2021-10-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@
"close": "37",
"low": "35.55",
"high": "37.42",
"volume": "51494"
"volume": "51494",
"exchange":"null"
},
{
"time": 1638316800000,
"open": "36.26",
"close": "32.99",
"low": "32.3",
"high": "36.918",
"volume": "34644"
"volume": "34644",
"exchange":"null"
},
{
"time": 1640995200000,
"open": "43.6",
"close": "42.7",
"low": "40.98",
"high": "44.24",
"volume": "124668"
"volume": "124668",
"exchange":"null"
}
]
}
Expand All @@ -38,4 +41,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "33.505",
"low": "32.98",
"high": "45.9999",
"volume": "810540"
"volume": "810540",
"exchange":"null"
},
{
"time": 1640995200000,
"open": "33.05",
"close": "32.99",
"low": "29.95",
"high": "38.68",
"volume": "481067"
"volume": "481067",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@
"close": "23.86",
"low": "22.395",
"high": "24.225",
"volume": "126204514"
"volume": "126204514",
"exchange":"null"
},
{
"time": 1618185600000,
"open": "24.46",
"close": "23.54",
"low": "22.63",
"high": "24.85",
"volume": "142463182"
"volume": "142463182",
"exchange":"null"
},
{
"time": 1618790400000,
"open": "23.232",
"close": "22.03",
"low": "21.66",
"high": "23.35",
"volume": "166258935"
"volume": "166258935",
"exchange":"null"
}
]
}
Expand All @@ -38,4 +41,4 @@
"end": "2021-04-19T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"close": "32.99",
"low": "29.5",
"high": "48.3073",
"volume": "3879291"
"volume": "3879291",
"exchange":"null"
}
]
}
Expand All @@ -22,4 +23,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "37",
"low": "35.55",
"high": "41.96",
"volume": "81913"
"volume": "81913",
"exchange":"null"
},
{
"time": 1640995200000,
"open": "36.26",
"close": "42.7",
"low": "32.3",
"high": "44.24",
"volume": "159312"
"volume": "159312",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2022-01-01T00:00:00.000Z"
}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"close": "23.86",
"low": "21.02",
"high": "24.7",
"volume": "355594467"
"volume": "355594467",
"exchange":"null"
},
{
"time": 1618790400000,
"open": "24.46",
"close": "22.03",
"low": "21.66",
"high": "24.85",
"volume": "308722117"
"volume": "308722117",
"exchange":"null"
}
]
}
Expand All @@ -30,4 +32,4 @@
"end": "2021-04-19T00:00:00.000Z"
}
}
]
]
Loading

0 comments on commit e0715c2

Please sign in to comment.