I’m developing an app in Spring Boot. I use a PostreSQL DB for production, and I want my JUnit 5 tests to run on a H2 memory DB. Problem is, after some configuration, the tests still don’t seem to run on the in-memory db: I can access entities from the prod db (a saved entity doesn’t persist in the prod
Tag: java
Is there such a query for mongodb?
I need to do a query on mongoDB due to I am developing in Java with Spring Boot and MongoDB. I know that this command is for arrays: This query let me to find if all fields of the arraylist “skillsOfCV” are in the arraylist called “skills” However, I am trying to pass an arraylist as “skillsOfCV” to compare all
How can I collect two-dimensional Array into a Map<String, Set>?
I have an array of arrays of two strings. How can I collect the above array into a Map<String, Set<String>> whose key is the first element of each array and the value is a set of second elements of the array? So that I get following map? So far, I found I can classify the first element of each array
Is instantiating an instance of an abstract class a runtime or compilation error?
From my understanding, no objects are instantiated in compilation time. Hence, the error should be classified as a run time error when the instance of the abstract object is created in runtime. Am I correct or will such an error be picked up by the compiler before runtime? Answer The work of compiler basically boils down to accepting your java
I’m receiving an java.lang.AssertionError in a test using REST Assured
This is the first time for me using Gson and REST Assured, and I am really struggling to be honest. I need to verify that the content type is JSON and it is, but the test fails with the following message that you will see below. I am not writing all the imports that I have, if it is needed
How to obtain the info inside a String without length and indexOF. (JAVA)
I have an api which returns a String in the following format: ACTNEW_38_0001,ACTO_57999 I need to extract the numerical values (57999, or 38_0001) but: 1: They can arrive in different order. 2: It can arrive only one of them. 3: It has to be lightweight. I roughly know how to do it. My actual code looks more or less like
IntelliJ Idea IDE: Abnormal build process termination. How to fix that?
I guess that’s because of Cyrillic symbols in paths which IDE cannot digest correctly during build process, but I cannot just rename this folder in Windows 10. Tried to make a junction using MKLINK J, but it didn’t help.. I suppose the Cyrillic symbols in Windows username made the IDE throw but I couldn’t fix it. Reinstalling IDE didn’t bring
Finding elements in array using for loop
I am trying to add Scanner inputs into an array and I am trying to search for the element in an array using a for loop. The for loop looped through all the elements and print out “Not here” when names[i] is not equal to the Scanner input. How do I fix this issue ? Answer
Creating a Java increasing alphabet grid with a 5×5 array
The grid I need to recreate looks like this The grid I have now looks like this My code for creating the grid I have already declared these variables in the public class, not my main method. How would I achieve this? I tried changing the int’s in the middle section of my map to char like my top and
How to call an 2D – Array which was iniciated in another class?
I made a minimal reduced example of my problem: The Maze class creates a 2D Boolean Array with the Method generateMaze() (The content of mazeArray is irrelevant in this example). The main-Thread from Walker calls that Method and thereby creates this mazeArray from the Maze-class. I do not understand how I can call this Array in Walker.walk? Im affraid I