Skip to main content

Questions tagged [junit]

JUnit is a unit testing framework for the Java language.

3 votes
3 answers
155 views

IPv4 filter in Java

I have a simple class for representing IPv4-addresses via int values, and a simple IP-address filter that works like a set of IPv4-addresses. ...
coderodde's user avatar
  • 28.9k
2 votes
1 answer
542 views

Basic Ticket booking code with Unit tests

I am going to run a session for a few other developers who are new to Junit, mocking, etc. I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
HariHaravelan's user avatar
1 vote
1 answer
103 views

Binary Search tree, leaves method [closed]

I have written a code of Binary Search tree that extends comparable and implements an interface. The code for leaves and the helper method countLeaves, makes sure that all of the test goes through ...
user17024023's user avatar
2 votes
1 answer
397 views

HashTable Implementation with JUNIT testing

I have written a hashtable that implements a set interface. With JUNIT all my test goes through, however I am unsure if they are written correctly based on what their description is. Down here I have ...
ee ss's user avatar
  • 21
5 votes
2 answers
492 views

Hungarian algorithm for optimal assignment

The assignment problem is about assigning tasks to workers, where each pair (worker, task) has a cost. The Hungarian algorithm builds an optimal solution for this problem. It has two variants, ...
Anab's user avatar
  • 365
3 votes
1 answer
1k views

Testing DAO Delete User

I have several Dao classes, including a UserDao, below. The DAOs have many methods, but I'm focussing on deleteUser: ...
DozezQuest's user avatar
0 votes
2 answers
1k views

Need Feedback on JUnit test comparing two timestamps

I am writng a JUnit test case for the below methods : ...
user3254725's user avatar
4 votes
2 answers
257 views

Are these Unit tests OK or am I implementing an antipattern or not following best practices

I am testing a Spring boot service using JUnit 5 and Mockito. I haven't spent much time on unit testing in the past so I'm not sure if I'm accidentally implementing an anti-pattern or not following ...
user2094257's user avatar
3 votes
0 answers
187 views

Migrate customer and transaction data from CSV to MongoDB

I wrote a Java Spring Boot application with MongoDB that on every application start loads customer, account type and transaction details from CSV files to MongoDB. It has one end point that returns ...
user232946's user avatar
3 votes
2 answers
772 views

Palindrome Algorithm and JUnit 5 Tests

I have a "Palindrome" class that has some functions for verifying if certain things are Palindromes. For the verification, I have 2 different algorithms, one being recursive and the other ...
George R's user avatar
  • 231
4 votes
1 answer
764 views

Proper way to unit test MD5 Hashing of Zip Files from URL using JUnit 5?

Am using Java 1.8 and JUnit 5 to test a program which I wrote which grabs external zip files from a public url and then converts them into MD5 based hashes. This post / question serves as not only a ...
PacificNW_Lover's user avatar
3 votes
2 answers
494 views

Unit testing Roman-Arabic-Roman numeric converter

As you can see here, I wrote the methods public static int romanToArabic(String number) and ...
user avatar
5 votes
3 answers
3k views

Mars Rover technical Challenge in OOP

I am trying to practice OOP and TDD concepts, I have written this code for Mars rover challenge from marsrovertechchallenge . Can you please review my code from my GitHub repository? Or you can ...
Sara Elmenshawy's user avatar
13 votes
5 answers
2k views

Find most "academic" implementation of doubly linked list

Recently, a company has asked me to make an implementation of a doubly linked list with unity tests to test my skills. In the task description they specified that the solution should be as academic as ...
Raider's user avatar
  • 233
3 votes
0 answers
1k views

Android+Firebase testing using Mockito

I have an interactor/usecase class in my application. My application follows MVVM architecture with interactor/usecases responsible for logic (e.g. get data from api-service, store in local-database ...
CJR's user avatar
  • 151

15 30 50 per page
1
2 3 4 5 6