andrei-punko / java-interview-coding Goto Github PK
View Code? Open in Web Editor NEWCoding playground for preparation to Java interview
License: MIT License
Coding playground for preparation to Java interview
License: MIT License
public enum EventType {
SOME_EVENT("someEvent") { @Override public String parse(byte[] data) {throw new UnsupportedOperationException();}},
SOME_OTHER_EVENT("someOtherEvent") { @Override public String parse(byte[] data) {throw new UnsupportedOperationException();}},
ONE_MORE_EVENT("oneMoreEvent"){ @Override public String parse(byte[] data) {throw new UnsupportedOperationException();}};
final String type;
public String parse(byte[] data) {throw new UnsupportedOperationException();}
EventType(String type) {
this.type = type;
}
public static EventType getByValue(String value) {
return Arrays.stream(EventType.values())
.filter(typeValue -> typeValue.type.equalsIgnoreCase(value))
.findFirst()
.orElseThrow(NoSuchElementException::new);
}
}
public class EventParser {
public List<String> parse(List<Event> events) {
return events.stream()
.map(event -> EventType.getByValue(event.getType()).parse(event.getData()))
.collect(Collectors.toList());
}
}
From some moment build on GitHub failed for 11 tests which use awaitility lib.
First time it happens in this build: https://github.com/andrei-punko/java-interview-coding/actions/runs/6936116541
Locally build passed successfully.
Need to fix it to make it green.
search(by.andd3dfx.sitesparsing.tutby.TutByJobSearchUtilTest) Time elapsed: 3.095 sec <<< FAILURE!
java.lang.AssertionError: Next url should be present
Expected: is "http://jobs.tut.by/search/vacancy?L_is_autosearch=false&area=1002&clusters=true&enable_snippets=true&text=java&page=1"
but: was "http://jobs.tut.by/search/vacancy?area=1002&text=java&page=1"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at by.andd3dfx.sitesparsing.tutby.TutByJobSearchUtilTest.search(TutByJobSearchUtilTest.java:25)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.