Skip to content

Instantly share code, notes, and snippets.

View Network.txt
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
client.test("Headers option exists", function() {
const {body} = response;
client.assert(body.hasOwnProperty('PropertyName'), "No 'PropertyName' in response");
});
View response.json
{
"id": 0,
"uuid": "5636e510-2176-4c4f-b8b9-3d2de550a8a6",
"firstName": "Brown",
"lastName": "Tania",
"avatar": "http://placeimg.com/640/480/business",
"email": "Kale69@gmail.com"
}
View repeate.js
[
{{# repeat 3}}
{
"id": {{ @index }},
"uuid": "{{ faker 'random.uuid' }}",
"name": "{{ faker 'name.firstName' }}",
"lastName": "{{faker 'name.firstName'}}",
"text": "Hello world"
}
{{/ repeat}}
View AppConfiguration.java
package com.nemrosim;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan({"com.nemrosim"})
public class AppConfiguration {}
View AppConfiguration.java
package com.nemrosim;
import com.nemrosim.repositories.HibernateUserRepositoryImpl;
import com.nemrosim.repositories.UserRepository;
import com.nemrosim.services.UserService;
import com.nemrosim.services.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
View UserServiceImpl.java
package com.nemrosim.services;
import com.nemrosim.models.User;
import com.nemrosim.repositories.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class UserServiceImpl implements UserService {
View Application.java
package com.nemrosim;
import com.nemrosim.models.User;
import com.nemrosim.services.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class Application {
public static void main(String[] args) {
ApplicationContext context = new AnnotationConfigApplicationContext(AppConfiguration.class);
View AppConfiguration.java
package com.nemrosim;
import com.nemrosim.repositories.HibernateUserRepositoryImpl;
import com.nemrosim.repositories.UserRepository;
import com.nemrosim.services.UserService;
import com.nemrosim.services.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
View UserService.java
package com.nemrosim.services;
import com.nemrosim.models.User;
import java.util.List;
public interface UserService {
List<User> findAll();
}
View UserServiceImpl.java
package com.nemrosim.services;
import com.nemrosim.models.User;
import com.nemrosim.repositories.UserRepository;
import java.util.List;
public class UserServiceImpl implements UserService {
private UserRepository repository;