Tag: junit
Posts of Tag: junit
  1. How to Test a Spring Boot Application

    How to Test a Spring Boot Application Introduction Please note: The following article will be dedicated to testing Spring Boot applications. It's assumed that you are familiar with at least the basics of Java, ...Learn More
    JavaSpring BootmockitojunitSpringProgramming Languages
  2. Guide to Unit Testing Spring Boot REST APIs

    Introduction Testing the system is an important phase in a Software Development Life Cycle (SDLC). Testing promotes code reliability, robustness, and ensures high-quality software delivered to clients if implem...Learn More
    JavamockitojunitSpringtestingtddrestAPIProgramming Languages
  3. JUnit: testing API with WebTestClient

    For the sake of getting straight to the point, we will assume followings, so that we can look directly into testing. We have a RestController with two get mappings. ‘/flux’ returns Flux in default media type —...Learn More
    NewsReactor Projectreactive programmingSpring BootFluxjunitBlog
  4. Give a new lease of life to src/test/java

    Before I start a quick question to all of you; So how many of you were excited to switch to new functional paradigm of programming in Java? I was very excited when I started learning the more declarative way of...Learn More
    NewsjunitUnittestClean CodeAssertjJavaBlogProgramming Languages
  5. [Spring Boot] How to stub @AuthenticationPrincipal argument with Spring-Security in Unit Tests

    There may be some situations where user information is required as part of business logic. Quite often, this process takes place after authentication. In this article, let us find out how user information can b...Learn More
    NewsjunitSpring BootUnit Testingtddspring securityBlog
  6. How do I unit test a custom ant task?

    I am writing a custom ant task that extends Task. I am using the log() method in the task. What I want to do is use a unit test while deveoping the task, but I don't know how to set up a context for the task to...Learn More
    antjunit
  7. What can cause intermittent ORA-12519 (TNS: no appropriate handler found) errors

    We are running our Junit 4 test suite against Weblogic 9 in front of an Oracle 10 database (using Hudson as a continuous integration server) and occasionally we will get an ORA-12519 crash during script teardow...Learn More
    Oraclejunitoracle10gora-12519
  8. Best way to automagically migrate tests from JUnit 3 to JUnit 4?

    I have a bunch of JUnit 3 classes which extend TestCase and would like to automatically migrate them to be JUnit4 tests with annotations such as @Before, @After, @Test, etc. Any tool out there to do this in a b...Learn More
    JavajunitMigrationProgramming Languages
  9. How do I unit test jdbc code in java?

    I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results. (Without actually using a database) Another developer here wrote our own D...Learn More
    JavaDatabaseunit-testingJDBCjunitProgramming LanguagesDev
  10. Automatically add properties when running JUnit in Eclipse

    In order to run my unit tests on my Eclipse, I need to set some properties for the VM. Thus, when I first run my JUnit test, I go in "Open Run Dialog", then in my JUnit configuration for this test, I go in "Ar...Learn More
    EclipseConfigurationjunit
  11. Strategies to mock a webservice

    I'm implementing a client consuming a webservice. I want to reduce dependencies and decided to mock the webservice. I use mockito, it has the advantage vs. EasyMock to be able to mock classes, not just interfac...Learn More
    web-servicesunit-testingjunitMockingmockito
  12. How to test that a method should take more than X seconds to finish(with JUnit)?

    Basically I need the opposite behaviour of the @Test(timeout=X) annotation. The problem I want to solve is to detect in some way that the method never ends (as a right behaviour). I am assuming that if the met...Learn More
    junitinfinite-loop