Giter Site home page Giter Site logo

springexamples's Introduction

Spring Boot Examples by HowToDoInJava.com

This repository hosts the projects and their source codes written for various tutorials written in howtodoinjava.com.

springexamples's People

Contributors

dependabot[bot] avatar lokeshgupta1981 avatar wiktor89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

springexamples's Issues

Doubts about the code

@lokeshgupta1981 Hello, I have some doubts about some of your code in this library, I would like to ask, what is the function of the following code, I tried Google but still didn't understand it.
截屏2022-11-06 18 03 04

Problem

Hi,
I'm new to spring boot and testing. I was trying your sample to build my own test application but I had a problem in this section:

 //when
        ol__users result = Ol__userController.getAllAdminUsers();

this section for me doesn't replace the list that I had made in the test, it returns all data in the database. my sample code is written below for further information.

@Test
  @Transactional
  public void testFindAll(){
      ol__roles role=new ol__roles();
      role.setName("tests");
      role.setRole("Admin");
      role.setIs_master(true);
      Timestamp currentSqlTimestamp = new Timestamp(System.currentTimeMillis());
      ol__user user1=new ol__user("anteaaa","nejatiaan","[email protected]","anteaaaaa","12345","admin",true,role,"123",currentSqlTimestamp);
      ol__user user2=new ol__user("Nooria","Rajaee","[email protected]","Nooriaa","12345","admin",true,role,"123",currentSqlTimestamp);
      List<ol__user> list = new ArrayList<ol__user>();
      list.addAll(Arrays.asList(user1,user2));
      when(userRepository.findBydtype("admin")).thenReturn(list);
  //when
      ol__users result = Ol__userController.getAllAdminUsers();
 //then
      assertThat(result.getUsersList().size()).isEqualTo(2);
      assertThat(result.getUsersList().get(0).getFirst_name())
              .isEqualTo(user1.getFirst_name());

  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.