repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/fieldRepresentors/DoubleFieldRepresentorShould.java
// Path: src/com/nvinayshetty/DTOnator/FieldRepresentors/DoubleFieldRepresentor.java // public class DoubleFieldRepresentor extends FieldRepresentor { // @Override // public String getFieldRepresentationFor(AccessModifier accessModifier, String key) { // return accessModifier.getModifier() + "double" + ...
import com.nvinayshetty.DTOnator.FieldCreator.AccessModifier; import com.nvinayshetty.DTOnator.FieldRepresentors.DoubleFieldRepresentor; import org.junit.Test; import static junit.framework.TestCase.assertEquals;
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/FieldRepresentors/DoubleFieldRepresentor.java // public class DoubleFieldRepresentor extends FieldRepresentor { // @Override // public String getFieldRepresentationFor(AccessModifier accessModifier, String key) { // return accessModifier.getModifier() + "double" + ...
String actual = new DoubleFieldRepresentor().getFieldRepresentationFor(AccessModifier.PUBLIC, fieldName);
nvinayshetty/DTOnator
src/com/nvinayshetty/DTOnator/ClassCreator/EncapsulatedClassCreator.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldEncapsulationOptions.java // public enum FieldEncapsulationOptions { // PROVIDE_GETTER, PROVIDE_SETTER, PROVIDE_PRIVATE_FIELD // } // // Path: src/com/nvinayshetty/DTOnator/NameConventionCommands/FieldNameParser.java // public class FieldNameParser { /...
import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElementFactory; import com.intellij.psi.PsiField; import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldEncapsulationOptions; import com.nvinayshetty.DTOnator.NameConventionCommands.FieldNameParser; import java.util.E...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldEncapsulationOptions.java // public enum FieldEncapsulationOptions { // PROVIDE_GETTER, PROVIDE_SETTER, PROVIDE_PRIVATE_FIELD // } // // Path: src/com/nvinayshetty/DTOnator/NameConventionCommands/FieldNameParser.java // public class FieldNameParser { /...
FieldNameParser nameParser;
nvinayshetty/DTOnator
src/com/nvinayshetty/DTOnator/FeedValidator/InputFeedValidationFactory.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FeedType.java // public enum FeedType { // JSON // }
import com.nvinayshetty.DTOnator.DtoCreationOptions.FeedType; import org.json.JSONException; import javax.swing.*;
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FeedType.java // public enum FeedType { // JSON // } // Path: src/com/nvinayshetty/DTOnator/FeedValidator/InputFeedValidationFactory.java import com.nvinayshetty.DTOnator.DtoCreationOptions.FeedType; import org.json.JSONException; import javax.swing.*; /*...
public InputFeedValidationFactory(FeedType feedType) {
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/fieldRepresentors/StringFieldRepresentorShould.java
// Path: src/com/nvinayshetty/DTOnator/FieldRepresentors/StringFieldRepresentor.java // public class StringFieldRepresentor extends FieldRepresentor { // @Override // public String getFieldRepresentationFor(AccessModifier accessModifier, String key) { // return accessModifier.getModifier() + "String" + ...
import static junit.framework.TestCase.assertEquals; import com.nvinayshetty.DTOnator.FieldCreator.AccessModifier; import com.nvinayshetty.DTOnator.FieldRepresentors.StringFieldRepresentor; import org.junit.Test;
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/FieldRepresentors/StringFieldRepresentor.java // public class StringFieldRepresentor extends FieldRepresentor { // @Override // public String getFieldRepresentationFor(AccessModifier accessModifier, String key) { // return accessModifier.getModifier() + "String" + ...
String actual = new StringFieldRepresentor().getFieldRepresentationFor(AccessModifier.PUBLIC, fieldName);
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactoryShould.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldType; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationFactory; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationStrategy; import com.nvinayshetty.DTOnator.FieldCreator.GsonFieldCreator; import com.nvinayshetty.DTOnator.FieldCreator.SimpleFiel...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
FieldCreationStrategy fieldCreationStrategy= FieldCreationFactory.getFieldCreatorFor(FieldType.GSON,"");
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactoryShould.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldType; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationFactory; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationStrategy; import com.nvinayshetty.DTOnator.FieldCreator.GsonFieldCreator; import com.nvinayshetty.DTOnator.FieldCreator.SimpleFiel...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
FieldCreationStrategy fieldCreationStrategy= FieldCreationFactory.getFieldCreatorFor(FieldType.GSON,"");
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactoryShould.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldType; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationFactory; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationStrategy; import com.nvinayshetty.DTOnator.FieldCreator.GsonFieldCreator; import com.nvinayshetty.DTOnator.FieldCreator.SimpleFiel...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
FieldCreationStrategy fieldCreationStrategy= FieldCreationFactory.getFieldCreatorFor(FieldType.GSON,"");
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactoryShould.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldType; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationFactory; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationStrategy; import com.nvinayshetty.DTOnator.FieldCreator.GsonFieldCreator; import com.nvinayshetty.DTOnator.FieldCreator.SimpleFiel...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
assertTrue(fieldCreationStrategy instanceof GsonFieldCreator);
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactoryShould.java
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
import com.nvinayshetty.DTOnator.DtoCreationOptions.FieldType; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationFactory; import com.nvinayshetty.DTOnator.FieldCreator.FieldCreationStrategy; import com.nvinayshetty.DTOnator.FieldCreator.GsonFieldCreator; import com.nvinayshetty.DTOnator.FieldCreator.SimpleFiel...
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/DtoCreationOptions/FieldType.java // public enum FieldType { // GSON, POJO,GSON_EXPOSE,JACKSON,CUSTOM,AUTO_VALUE // } // // Path: src/com/nvinayshetty/DTOnator/FieldCreator/FieldCreationFactory.java // public class FieldCreationFactory { // public static FieldCreationStra...
assertTrue(SimpleFieldCreationStrategy instanceof SimpleFieldCreator);
nvinayshetty/DTOnator
src/test/com/nvinayshetty/DTOnator/FeedValidator/KeyworldClassifierShould.java
// Path: src/com/nvinayshetty/DTOnator/FeedValidator/KeywordClassifier.java // public class KeywordClassifier { // private HashSet<String> javaKeywords = new HashSet<String>(); // // public void initKeywords() { // javaKeywords.add("abstract"); // javaKeywords.add("continue"); // javaKe...
import com.nvinayshetty.DTOnator.FeedValidator.KeywordClassifier; import org.junit.Test;
/* * Copyright (C) 2015 Vinaya Prasad N * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
// Path: src/com/nvinayshetty/DTOnator/FeedValidator/KeywordClassifier.java // public class KeywordClassifier { // private HashSet<String> javaKeywords = new HashSet<String>(); // // public void initKeywords() { // javaKeywords.add("abstract"); // javaKeywords.add("continue"); // javaKe...
KeywordClassifier clasifier = new KeywordClassifier();
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/spring2/Spring_2_Test.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
import me.chanjar.common.Bar; import me.chanjar.common.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener; import org.springframework.test.context.ContextConfig...
package me.chanjar.spring2; @ContextConfiguration(classes = { FooImpl.class, LooImpl.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class Spring_2_Test extends AbstractTestNGSpringContextTests { @MockBean
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
private Bar bar;
chanjarster/spring-test-examples
mvc/src/test/java/me/chanjar/springboot2/BootMvc_2_Test.java
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
import me.chanjar.web.Foo; import me.chanjar.web.FooController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoT...
package me.chanjar.springboot2; @WebMvcTest @ContextConfiguration(classes = { FooController.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class BootMvc_2_Test extends AbstractTestNGSpringContextTests { @Autowired private MockMvc mvc; @MockBean
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
private Foo foo;
chanjarster/spring-test-examples
rdbs/src/test/java/me/chanjar/spring2/Spring_2_IT.java
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
import me.chanjar.domain.Foo; import me.chanjar.domain.FooRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; import org.testng.annotations.T...
package me.chanjar.spring2; @ContextConfiguration(classes = Spring_2_IT_Configuration.class) public class Spring_2_IT extends AbstractTransactionalTestNGSpringContextTests { @Autowired
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
private FooRepository fooRepository;
chanjarster/spring-test-examples
rdbs/src/test/java/me/chanjar/spring2/Spring_2_IT.java
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
import me.chanjar.domain.Foo; import me.chanjar.domain.FooRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; import org.testng.annotations.T...
package me.chanjar.spring2; @ContextConfiguration(classes = Spring_2_IT_Configuration.class) public class Spring_2_IT extends AbstractTransactionalTestNGSpringContextTests { @Autowired private FooRepository fooRepository; @Test public void testSave() {
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
Foo foo = new Foo();
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/testng/ex1/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals;
package me.chanjar.basic.testng.ex1; public class FooServiceImplTest { @Test public void testPlusCount() {
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
FooService foo = new FooServiceImpl();
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/testng/ex1/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals;
package me.chanjar.basic.testng.ex1; public class FooServiceImplTest { @Test public void testPlusCount() {
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
FooService foo = new FooServiceImpl();
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/activeprofiles/ex2/ActiveProfileTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
import me.chanjar.annotation.activeprofiles.Bar; import me.chanjar.annotation.activeprofiles.Config; import me.chanjar.annotation.activeprofiles.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConf...
package me.chanjar.annotation.activeprofiles.ex2; @ContextConfiguration(classes = Config.class) @ActiveProfiles("product") public class ActiveProfileTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
private Foo foo;
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/activeprofiles/ex2/ActiveProfileTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
import me.chanjar.annotation.activeprofiles.Bar; import me.chanjar.annotation.activeprofiles.Config; import me.chanjar.annotation.activeprofiles.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConf...
package me.chanjar.annotation.activeprofiles.ex2; @ContextConfiguration(classes = Config.class) @ActiveProfiles("product") public class ActiveProfileTest extends AbstractTestNGSpringContextTests { @Autowired private Foo foo; @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
private Bar bar;
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex1/FooConfigurationTest.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.testng.Assert.assertNotNull;
package me.chanjar.configuration.ex1; public class FooConfigurationTest { private AnnotationConfigApplicationContext context; @BeforeMethod public void init() { context = new AnnotationConfigApplicationContext(); } @AfterMethod(alwaysRun = true) public void reset() { context.close(); } @T...
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex1/FooConfigurationTest.java import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.AnnotationConfigApplicationCo...
assertNotNull(context.getBean(Foo.class));
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex3/FooConfigurationTest.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.test.util.EnvironmentTestUtils; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.testng.annotations.AfterMethod; import org.tes...
package me.chanjar.configuration.ex3; public class FooConfigurationTest { private AnnotationConfigApplicationContext context; @BeforeMethod public void init() { context = new AnnotationConfigApplicationContext(); } @AfterMethod(alwaysRun = true) public void reset() { context.close(); } @T...
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex3/FooConfigurationTest.java import me.chanjar.configuration.service.Foo; import org.springframework.beans.factory.NoSuchBeanDefinitionException; imp...
context.getBean(Foo.class);
chanjarster/spring-test-examples
share-config/src/test/java/me/chanjar/shareconfig/annotation/FooRepositoryIT.java
// Path: share-config/src/test/java/me/chanjar/shareconfig/service/FooRepositoryTestBase.java // public class FooRepositoryTestBase extends AbstractTransactionalTestNGSpringContextTests { // // @Autowired // private FooRepository fooRepository; // // @Autowired // private Flyway flyway; // // @Test // pu...
import me.chanjar.shareconfig.service.FooRepositoryTestBase; import me.chanjar.shareconfig.testconfig.AnnotationConfiguration; import org.springframework.boot.test.context.SpringBootTest;
package me.chanjar.shareconfig.annotation; @SpringBootTest(classes = FooRepositoryIT.class) @AnnotationConfiguration
// Path: share-config/src/test/java/me/chanjar/shareconfig/service/FooRepositoryTestBase.java // public class FooRepositoryTestBase extends AbstractTransactionalTestNGSpringContextTests { // // @Autowired // private FooRepository fooRepository; // // @Autowired // private Flyway flyway; // // @Test // pu...
public class FooRepositoryIT extends FooRepositoryTestBase {
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex4/BarConfiguration.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.configuration.service.Bar; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; im...
package me.chanjar.configuration.ex4; @Configuration @EnableConfigurationProperties(BarConfiguration.BarProperties.class) public class BarConfiguration { @Autowired private BarProperties barProperties; @Bean
// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: configuration/src/test/java/me/chanjar...
public Bar bar() {
chanjarster/spring-test-examples
share-config/src/main/java/me/chanjar/shareconfig/config/FooRepositoryConfiguration.java
// Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepository.java // public interface FooRepository { // void save(Foo foo); // // void delete(String name); // } // // Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepositoryImpl.java // public class FooRepositoryImpl imple...
import me.chanjar.shareconfig.service.FooRepository; import me.chanjar.shareconfig.service.FooRepositoryImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.co...
package me.chanjar.shareconfig.config; @Configuration public class FooRepositoryConfiguration { @Autowired private JdbcTemplate jdbcTemplate; @Bean
// Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepository.java // public interface FooRepository { // void save(Foo foo); // // void delete(String name); // } // // Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepositoryImpl.java // public class FooRepositoryImpl imple...
public FooRepository fooRepository() {
chanjarster/spring-test-examples
share-config/src/main/java/me/chanjar/shareconfig/config/FooRepositoryConfiguration.java
// Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepository.java // public interface FooRepository { // void save(Foo foo); // // void delete(String name); // } // // Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepositoryImpl.java // public class FooRepositoryImpl imple...
import me.chanjar.shareconfig.service.FooRepository; import me.chanjar.shareconfig.service.FooRepositoryImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.co...
package me.chanjar.shareconfig.config; @Configuration public class FooRepositoryConfiguration { @Autowired private JdbcTemplate jdbcTemplate; @Bean public FooRepository fooRepository() {
// Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepository.java // public interface FooRepository { // void save(Foo foo); // // void delete(String name); // } // // Path: share-config/src/main/java/me/chanjar/shareconfig/service/FooRepositoryImpl.java // public class FooRepositoryImpl imple...
FooRepositoryImpl repository = new FooRepositoryImpl();
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/mockito/MockitoTest.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
import me.chanjar.common.Bar; import me.chanjar.common.FooImpl; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Collections; import static org.mockito.Mockito.when; import sta...
package me.chanjar.mockito; public class MockitoTest { @Mock
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
private Bar bar;
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/mockito/MockitoTest.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
import me.chanjar.common.Bar; import me.chanjar.common.FooImpl; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Collections; import static org.mockito.Mockito.when; import sta...
package me.chanjar.mockito; public class MockitoTest { @Mock private Bar bar; @InjectMocks
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
private FooImpl foo;
chanjarster/spring-test-examples
mvc/src/test/java/me/chanjar/spring2/SpringMvc_2_Test.java
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
import me.chanjar.web.Foo; import me.chanjar.web.FooController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener; import org.springframework.test.context.ContextConfig...
package me.chanjar.spring2; @EnableWebMvc @WebAppConfiguration
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
@ContextConfiguration(classes = { FooController.class })
chanjarster/spring-test-examples
mvc/src/test/java/me/chanjar/spring2/SpringMvc_2_Test.java
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
import me.chanjar.web.Foo; import me.chanjar.web.FooController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener; import org.springframework.test.context.ContextConfig...
package me.chanjar.spring2; @EnableWebMvc @WebAppConfiguration @ContextConfiguration(classes = { FooController.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringMvc_2_Test extends AbstractTestNGSpringContextTests { @Autowired private WebApplicationContext wac; ...
// Path: mvc/src/main/java/me/chanjar/web/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path ...
private Foo foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex3/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // }
import me.chanjar.basic.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; import static org.testng.Assert.ass...
package me.chanjar.basic.springboot.ex3; @SpringBootTest(classes = Config.class) public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // Path: basic/src/test/java/me/chanjar/basic/springboot/ex3/FooServiceImplTest.java import me.chanjar.basic.service.FooService; import org.springframewor...
private FooService foo;
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/testconfig/ex2/Config.java
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.annotation.testconfig.Foo; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;
package me.chanjar.annotation.testconfig.ex2; @Configuration public class Config { @Bean
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: annotation/src/test/java/me/chanjar/annot...
public Foo foo() {
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex3/SpringBootAopTest.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex3; @SpringBootTest(classes = { SpringBootAopTest.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringBootAopTest extends AbstractTestNGSpringContextTests { @SpyBean
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
private FooAspect fooAspect;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex3/SpringBootAopTest.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex3; @SpringBootTest(classes = { SpringBootAopTest.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringBootAopTest extends AbstractTestNGSpringContextTests { @SpyBean private FooAspect fooAspect; @Autowired
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
private FooService fooService;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex3/SpringBootAopTest.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex3; @SpringBootTest(classes = { SpringBootAopTest.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringBootAopTest extends AbstractTestNGSpringContextTests { @SpyBean private FooAspect fooAspect; @Autowired private FooS...
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
assertNotEquals(fooService.getClass(), FooServiceImpl.class);
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/springboot1/Boot_1_Test.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
import me.chanjar.common.Bar; import me.chanjar.common.Foo; import me.chanjar.common.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock....
package me.chanjar.springboot1; @SpringBootTest(classes = { FooImpl.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class Boot_1_Test extends AbstractTestNGSpringContextTests { @MockBean
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
private Bar bar;
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/springboot1/Boot_1_Test.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
import me.chanjar.common.Bar; import me.chanjar.common.Foo; import me.chanjar.common.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock....
package me.chanjar.springboot1; @SpringBootTest(classes = { FooImpl.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class Boot_1_Test extends AbstractTestNGSpringContextTests { @MockBean private Bar bar; @Autowired
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
private Foo foo;
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/spring1/Spring_1_Test.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
import me.chanjar.common.Bar; import me.chanjar.common.Foo; import me.chanjar.common.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener; import org.springframew...
package me.chanjar.spring1; @ContextConfiguration(classes = FooImpl.class) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class Spring_1_Test extends AbstractTestNGSpringContextTests { @MockBean
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
private Bar bar;
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/spring1/Spring_1_Test.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
import me.chanjar.common.Bar; import me.chanjar.common.Foo; import me.chanjar.common.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener; import org.springframew...
package me.chanjar.spring1; @ContextConfiguration(classes = FooImpl.class) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class Spring_1_Test extends AbstractTestNGSpringContextTests { @MockBean private Bar bar; @Autowired
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // // Path: mock/src/main/java/me/chanjar/common/...
private Foo foo;
chanjarster/spring-test-examples
mvc/src/test/java/me/chanjar/spring1/SpringMvc_1_Test.java
// Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET) // public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) { // ...
import me.chanjar.web.FooController; import me.chanjar.web.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.springframework.test.context.web.We...
package me.chanjar.spring1; @EnableWebMvc @WebAppConfiguration
// Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET) // public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) { // ...
@ContextConfiguration(classes = { FooController.class, FooImpl.class })
chanjarster/spring-test-examples
mvc/src/test/java/me/chanjar/spring1/SpringMvc_1_Test.java
// Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET) // public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) { // ...
import me.chanjar.web.FooController; import me.chanjar.web.FooImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.springframework.test.context.web.We...
package me.chanjar.spring1; @EnableWebMvc @WebAppConfiguration
// Path: mvc/src/main/java/me/chanjar/web/FooController.java // @Controller // public class FooController { // // @Autowired // private Foo foo; // // @RequestMapping(path = "/foo/check-code-dup", method = RequestMethod.GET) // public ResponseEntity<Boolean> checkCodeDuplicate(@RequestParam String code) { // ...
@ContextConfiguration(classes = { FooController.class, FooImpl.class })
chanjarster/spring-test-examples
rdbs/src/test/java/me/chanjar/springboot1/Boot_1_IT.java
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
import me.chanjar.domain.Foo; import me.chanjar.domain.FooRepository; import org.flywaydb.core.Flyway; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframewo...
package me.chanjar.springboot1; @SpringBootTest @SpringBootApplication(scanBasePackageClasses = FooRepository.class) public class Boot_1_IT extends AbstractTransactionalTestNGSpringContextTests { @Autowired private FooRepository fooRepository; @Autowired private Flyway flyway; @Test public void testSa...
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
Foo foo = new Foo();
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex1/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annot...
package me.chanjar.basic.springboot.ex1; @SpringBootTest(classes = FooServiceImpl.class) public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
private FooService foo;
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex3/FooConfiguration.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;
package me.chanjar.configuration.ex3; @Configuration public class FooConfiguration { @Bean @ConditionalOnProperty(prefix = "foo", name = "create", havingValue = "true")
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex3/FooConfiguration.java import me.chanjar.configuration.service.Foo; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; ...
public Foo foo() {
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex4/BarConfigurationTest.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.configuration.service.Bar; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.test.util.EnvironmentTestUtils; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.testng.annotations.AfterMe...
package me.chanjar.configuration.ex4; public class BarConfigurationTest { private AnnotationConfigApplicationContext context; @BeforeMethod public void init() { context = new AnnotationConfigApplicationContext(); } @AfterMethod(alwaysRun = true) public void reset() { context.close(); } @T...
// Path: configuration/src/main/java/me/chanjar/configuration/service/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: configuration/src/test/java/me/chanjar...
assertEquals(context.getBean(Bar.class).getName(), "test");
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex2/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotati...
package me.chanjar.basic.springboot.ex2; @SpringBootTest public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
private FooService foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex2/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotati...
package me.chanjar.basic.springboot.ex2; @SpringBootTest public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired private FooService foo; @Test public void testPlusCount() throws Exception { assertEquals(foo.getCount(), 0); foo.plusCount(); assertEquals(foo.getCoun...
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
@Import(FooServiceImpl.class)
chanjarster/spring-test-examples
rdbs/src/test/java/me/chanjar/spring1/Spring_1_IT.java
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
import me.chanjar.domain.Foo; import me.chanjar.domain.FooRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContext...
package me.chanjar.spring1; @ContextConfiguration(classes = Spring_1_IT_Configuration.class) public class Spring_1_IT extends AbstractTestNGSpringContextTests { @Autowired
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
private FooRepository fooRepository;
chanjarster/spring-test-examples
rdbs/src/test/java/me/chanjar/spring1/Spring_1_IT.java
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
import me.chanjar.domain.Foo; import me.chanjar.domain.FooRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContext...
package me.chanjar.spring1; @ContextConfiguration(classes = Spring_1_IT_Configuration.class) public class Spring_1_IT extends AbstractTestNGSpringContextTests { @Autowired private FooRepository fooRepository; @Autowired private JdbcTemplate jdbcTemplate; @Test public void testSave() {
// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java // public class Foo { // // private String name; // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // } // // Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java /...
Foo foo = new Foo();
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/jsontest/ex3/ThinJsonTest.java
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
import me.chanjar.annotation.jsontest.ex1.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.json.JsonTest; import org.springframework.boot.test.json.JacksonTester; import org.springframework.test.context.ContextConfiguration; import org.springframewor...
package me.chanjar.annotation.jsontest.ex3; @JsonTest @ContextConfiguration(classes = ThinJsonTest.class) public class ThinJsonTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
private JacksonTester<Foo> json;
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/testconfig/ex2/TestConfigurationTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.annotation.testconfig.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import ...
package me.chanjar.annotation.testconfig.ex2; @SpringBootTest(classes = { Config.class, TestConfig.class }) public class TestConfigurationTest extends AbstractTestNGSpringContextTests { @Qualifier("foo") @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: annotation/src/test/java/me/chanjar/annot...
private Foo foo;
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/jsontest/ex2/FooJsonComponent.java
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; imp...
package me.chanjar.annotation.jsontest.ex2; /** * Created by qianjia on 2017/7/19. */ @JsonComponent public class FooJsonComponent {
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
public static class Serializer extends JsonSerializer<Foo> {
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/testconfig/ex1/TestConfigurationTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.annotation.testconfig.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.con...
package me.chanjar.annotation.testconfig.ex1; @SpringBootTest @SpringBootConfiguration public class TestConfigurationTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: annotation/src/test/java/me/chanjar/annot...
private Foo foo;
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex2/FooConfigurationTest.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.core.env.MapPropertySource; import org.testng.annotations.AfterMethod; import org.testng.annot...
package me.chanjar.configuration.ex2; public class FooConfigurationTest { private AnnotationConfigApplicationContext context; @BeforeMethod public void init() { context = new AnnotationConfigApplicationContext(); } @AfterMethod(alwaysRun = true) public void reset() { context.close(); } @...
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex2/FooConfigurationTest.java import me.chanjar.configuration.service.Foo; import org.springframework.beans.factory.NoSuchBeanDefinitionException; imp...
context.getBean(Foo.class);
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex2/FooConfiguration.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.*; import org.springframework.core.type.AnnotatedTypeMetadata;
package me.chanjar.configuration.ex2; @Configuration public class FooConfiguration { @Bean @Conditional(FooCondition.class)
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex2/FooConfiguration.java import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.*; import org.springframework.cor...
public Foo foo() {
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/spring2/LooImpl.java
// Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // }
import me.chanjar.common.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;
package me.chanjar.spring2; @Component public class LooImpl implements Loo {
// Path: mock/src/main/java/me/chanjar/common/Foo.java // public interface Foo { // // boolean checkCodeDuplicate(String code); // // } // Path: mock/src/test/java/me/chanjar/spring2/LooImpl.java import me.chanjar.common.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframewor...
private Foo foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/spring/ex3/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // }
import me.chanjar.basic.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; import static org.testng.Assert.as...
package me.chanjar.basic.spring.ex3; @ContextConfiguration(classes = Config.class) public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // Path: basic/src/test/java/me/chanjar/basic/spring/ex3/FooServiceImplTest.java import me.chanjar.basic.service.FooService; import org.springframework.be...
private FooService foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex6/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // }
import me.chanjar.basic.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; import static org.testng.Assert.ass...
package me.chanjar.basic.springboot.ex6; @SpringBootTest public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // Path: basic/src/test/java/me/chanjar/basic/springboot/ex6/FooServiceImplTest.java import me.chanjar.basic.service.FooService; import org.springframewor...
private FooService foo;
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/no_mock/NoMockTest.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
import me.chanjar.common.Bar; import me.chanjar.common.FooImpl; import org.testng.annotations.Test; import java.util.Collections; import java.util.Set; import static org.testng.Assert.assertEquals;
package me.chanjar.no_mock; public class NoMockTest { @Test public void testCheckCodeDuplicate1() throws Exception {
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
FooImpl foo = new FooImpl();
chanjarster/spring-test-examples
mock/src/test/java/me/chanjar/no_mock/NoMockTest.java
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
import me.chanjar.common.Bar; import me.chanjar.common.FooImpl; import org.testng.annotations.Test; import java.util.Collections; import java.util.Set; import static org.testng.Assert.assertEquals;
package me.chanjar.no_mock; public class NoMockTest { @Test public void testCheckCodeDuplicate1() throws Exception { FooImpl foo = new FooImpl();
// Path: mock/src/main/java/me/chanjar/common/Bar.java // public interface Bar { // // Set<String> getAllCodes(); // // } // // Path: mock/src/main/java/me/chanjar/common/FooImpl.java // @Component // public class FooImpl implements Foo { // // private Bar bar; // // @Override // public boolean checkCodeDu...
foo.setBar(new Bar() {
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/activeprofiles/ex1/ActiveProfileTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
import me.chanjar.annotation.activeprofiles.Bar; import me.chanjar.annotation.activeprofiles.Config; import me.chanjar.annotation.activeprofiles.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testn...
package me.chanjar.annotation.activeprofiles.ex1; @ContextConfiguration(classes = Config.class) public class ActiveProfileTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
private Foo foo;
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/activeprofiles/ex1/ActiveProfileTest.java
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
import me.chanjar.annotation.activeprofiles.Bar; import me.chanjar.annotation.activeprofiles.Config; import me.chanjar.annotation.activeprofiles.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testn...
package me.chanjar.annotation.activeprofiles.ex1; @ContextConfiguration(classes = Config.class) public class ActiveProfileTest extends AbstractTestNGSpringContextTests { @Autowired private Foo foo; @Autowired
// Path: annotation/src/main/java/me/chanjar/annotation/activeprofiles/Bar.java // public class Bar { // // private final String name; // // public Bar(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // } // // Path: annotation/src/main/java/me/cha...
private Bar bar;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex5/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // }
import me.chanjar.basic.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; import static org.testng.Assert.ass...
package me.chanjar.basic.springboot.ex5; @SpringBootTest public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // Path: basic/src/test/java/me/chanjar/basic/springboot/ex5/FooServiceImplTest.java import me.chanjar.basic.service.FooService; import org.springframewor...
private FooService foo;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex1/SpringAop_1_Test.java
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java // @Configuration // @EnableAspectJAutoProxy(proxyTargetClass = true) // @ComponentScan("me.chanjar.aop") // public class AopConfig { // // } // // Path: aop/src/main/java/me/chanjar/aop/service/FooService.java // public interface FooService { // // i...
import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframewo...
package me.chanjar.aop.ex1; @ContextConfiguration(classes = { SpringAop_1_Test.class, AopConfig.class }) public class SpringAop_1_Test extends AbstractTestNGSpringContextTests { @Autowired
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java // @Configuration // @EnableAspectJAutoProxy(proxyTargetClass = true) // @ComponentScan("me.chanjar.aop") // public class AopConfig { // // } // // Path: aop/src/main/java/me/chanjar/aop/service/FooService.java // public interface FooService { // // i...
private FooService fooService;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex1/SpringAop_1_Test.java
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java // @Configuration // @EnableAspectJAutoProxy(proxyTargetClass = true) // @ComponentScan("me.chanjar.aop") // public class AopConfig { // // } // // Path: aop/src/main/java/me/chanjar/aop/service/FooService.java // public interface FooService { // // i...
import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframewo...
package me.chanjar.aop.ex1; @ContextConfiguration(classes = { SpringAop_1_Test.class, AopConfig.class }) public class SpringAop_1_Test extends AbstractTestNGSpringContextTests { @Autowired private FooService fooService; @Test public void testFooService() {
// Path: aop/src/main/java/me/chanjar/aop/config/AopConfig.java // @Configuration // @EnableAspectJAutoProxy(proxyTargetClass = true) // @ComponentScan("me.chanjar.aop") // public class AopConfig { // // } // // Path: aop/src/main/java/me/chanjar/aop/service/FooService.java // public interface FooService { // // i...
assertNotEquals(fooService.getClass(), FooServiceImpl.class);
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/jsontest/ex2/JsonComponentJacksonTest.java
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
import me.chanjar.annotation.jsontest.ex1.Foo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.json.JsonTest; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.json.JacksonTester; import org.springframework...
package me.chanjar.annotation.jsontest.ex2; @SpringBootTest(classes = { JsonComponentJacksonTest.class, FooJsonComponent.class }) @JsonTest public class JsonComponentJacksonTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: annotation/src/test/java/me/chanjar/annotation/jsontest/ex1/Foo.java // public class Foo { // // private String name; // // private int age; // // public Foo() { // } // // public Foo(String name, int age) { // this.name = name; // this.age = age; // } // // public String getName() {...
private JacksonTester<Foo> json;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex2/SpringAop_2_Test.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex2; @ContextConfiguration(classes = { SpringAop_2_Test.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringAop_2_Test extends AbstractTestNGSpringContextTests { @SpyBean
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
private FooAspect fooAspect;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex2/SpringAop_2_Test.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex2; @ContextConfiguration(classes = { SpringAop_2_Test.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringAop_2_Test extends AbstractTestNGSpringContextTests { @SpyBean private FooAspect fooAspect; @Autowired
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
private FooService fooService;
chanjarster/spring-test-examples
aop/src/test/java/me/chanjar/aop/ex2/SpringAop_2_Test.java
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
import me.chanjar.aop.aspect.FooAspect; import me.chanjar.aop.config.AopConfig; import me.chanjar.aop.service.FooService; import me.chanjar.aop.service.FooServiceImpl; import org.springframework.aop.framework.AopProxyUtils; import org.springframework.aop.support.AopUtils; import org.springframework.beans.factory.annota...
package me.chanjar.aop.ex2; @ContextConfiguration(classes = { SpringAop_2_Test.class, AopConfig.class }) @TestExecutionListeners(listeners = MockitoTestExecutionListener.class) public class SpringAop_2_Test extends AbstractTestNGSpringContextTests { @SpyBean private FooAspect fooAspect; @Autowired private ...
// Path: aop/src/main/java/me/chanjar/aop/aspect/FooAspect.java // @Component // @Aspect // public class FooAspect { // // @Pointcut("execution(* me.chanjar.aop.service.FooServiceImpl.incrementAndGet())") // public void pointcut() { // } // // @Around("pointcut()") // public int changeIncrementAndGet(Procee...
assertNotEquals(fooService.getClass(), FooServiceImpl.class);
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/testconfig/ex2/TestConfig.java
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.annotation.testconfig.Foo; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean;
package me.chanjar.annotation.testconfig.ex2; @TestConfiguration public class TestConfig { @Bean
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: annotation/src/test/java/me/chanjar/annot...
public Foo foo() {
chanjarster/spring-test-examples
annotation/src/test/java/me/chanjar/annotation/testconfig/ex3/TestConfig.java
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // }
import me.chanjar.annotation.testconfig.Foo; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean;
package me.chanjar.annotation.testconfig.ex3; @TestConfiguration public class TestConfig { @Bean
// Path: annotation/src/main/java/me/chanjar/annotation/testconfig/Foo.java // public class Foo { // // private final String name; // // public Foo(String name) { // this.name = name; // } // // public String getName() { // return name; // } // } // Path: annotation/src/test/java/me/chanjar/annot...
public Foo foo() {
chanjarster/spring-test-examples
configuration/src/test/java/me/chanjar/configuration/ex1/FooConfiguration.java
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // }
import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;
package me.chanjar.configuration.ex1; @Configuration public class FooConfiguration { @Bean
// Path: configuration/src/main/java/me/chanjar/configuration/service/Foo.java // public class Foo { // } // Path: configuration/src/test/java/me/chanjar/configuration/ex1/FooConfiguration.java import me.chanjar.configuration.service.Foo; import org.springframework.context.annotation.Bean; import org.springframework....
public Foo foo() {
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/spring/ex1/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.anno...
package me.chanjar.basic.spring.ex1; @ContextConfiguration(classes = FooServiceImpl.class) public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
private FooService foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/spring/ex2/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.test.context.ContextCon...
package me.chanjar.basic.spring.ex2; @ContextConfiguration public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
private FooService foo;
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/spring/ex2/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
import me.chanjar.basic.service.FooService; import me.chanjar.basic.service.FooServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.test.context.ContextCon...
package me.chanjar.basic.spring.ex2; @ContextConfiguration public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired private FooService foo; @Test public void testPlusCount() throws Exception { assertEquals(foo.getCount(), 0); foo.plusCount(); assertEquals(foo.getCo...
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // // Path: basic/src/main/java/me/chanjar/basic/service/FooServiceImpl.java // @Component // public class FooServiceImpl implements FooService { // // ...
@Import(FooServiceImpl.class)
chanjarster/spring-test-examples
basic/src/test/java/me/chanjar/basic/springboot/ex4/FooServiceImplTest.java
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // }
import me.chanjar.basic.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.Test; import static org.testng.Assert.ass...
package me.chanjar.basic.springboot.ex4; @SpringBootTest public class FooServiceImplTest extends AbstractTestNGSpringContextTests { @Autowired
// Path: basic/src/main/java/me/chanjar/basic/service/FooService.java // public interface FooService { // // void plusCount(); // // int getCount(); // // } // Path: basic/src/test/java/me/chanjar/basic/springboot/ex4/FooServiceImplTest.java import me.chanjar.basic.service.FooService; import org.springframewor...
private FooService foo;
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/Explodable.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Folder.java // public final class Folder // { // /** Entities folder. */ // public static final String ENTITIES = "entity"; // /** Effects folder. */ // public static final String EFFECTS = "effect"; // /** Items folder. */ // ...
import com.b3dgs.lionengine.Medias; import com.b3dgs.lionengine.game.feature.FeatureGet; import com.b3dgs.lionengine.game.feature.FeatureInterface; import com.b3dgs.lionengine.game.feature.FeatureModel; import com.b3dgs.lionengine.game.feature.Identifiable; import com.b3dgs.lionengine.game.feature.Routine; import...
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Folder.java // public final class Folder // { // /** Entities folder. */ // public static final String ENTITIES = "entity"; // /** Effects folder. */ // public static final String EFFECTS = "effect"; // /** Items folder. */ // ...
spawner.spawn(Medias.create(Folder.EFFECTS, "explode.xml"), transformable)
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/action/Extract.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/RightClickExtract.java // @FeatureInterface // public class RightClickExtract extends FeatureModel implements RightClickHandler // { // private final Cursor cursor = services.get(Cursor.class); // private final Handler handler = services...
import java.util.List; import com.b3dgs.lionengine.game.feature.Services; import com.b3dgs.lionengine.game.feature.Setup; import com.b3dgs.lionengine.game.feature.collidable.selector.Selectable; import com.b3dgs.warcraft.object.feature.RightClickExtract;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/RightClickExtract.java // @FeatureInterface // public class RightClickExtract extends FeatureModel implements RightClickHandler // { // private final Cursor cursor = services.get(Cursor.class); // private final Handler handler = services...
selectable.getFeature(RightClickExtract.class).execute();
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/action/Stop.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
import java.util.List; import com.b3dgs.lionengine.game.feature.Services; import com.b3dgs.lionengine.game.feature.Setup; import com.b3dgs.lionengine.game.feature.attackable.Attacker; import com.b3dgs.lionengine.game.feature.collidable.selector.Selectable; import com.b3dgs.lionengine.game.feature.tile.map.extracta...
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
selectable.getFeature(EntitySfx.class).onOrdered();
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/action/Move.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
import java.util.List; import com.b3dgs.lionengine.game.feature.Services; import com.b3dgs.lionengine.game.feature.Setup; import com.b3dgs.lionengine.game.feature.attackable.Attacker; import com.b3dgs.lionengine.game.feature.collidable.selector.Selectable; import com.b3dgs.lionengine.game.feature.tile.map.extracta...
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
selection.get(0).getFeature(EntitySfx.class).onOrdered();
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/Race.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Folder.java // public final class Folder // { // /** Entities folder. */ // public static final String ENTITIES = "entity"; // /** Effects folder. */ // public static final String EFFECTS = "effect"; // /** Items folder. */ // ...
import java.util.Locale; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.lionengine.game.feature.Factory; import com.b3dgs.warcraft.constant.Folder;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Folder.java // public final class Folder // { // /** Entities folder. */ // public static final String ENTITIES = "entity"; // /** Effects folder. */ // public static final String EFFECTS = "effect"; // /** Items folder. */ // ...
return Medias.create(Folder.ENTITIES, folder, unit.get() + Factory.FILE_DATA_DOT_EXTENSION);
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/Level.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
import com.b3dgs.lionengine.Check; import com.b3dgs.lionengine.LionEngineException; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.warcraft.constant.Extension; import com.b3dgs.warcraft.constant.Folder;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
this.level = Medias.create(Folder.MAPS, folder, level + Extension.LEVEL);
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/Level.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
import com.b3dgs.lionengine.Check; import com.b3dgs.lionengine.LionEngineException; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.warcraft.constant.Extension; import com.b3dgs.warcraft.constant.Folder;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
this.level = Medias.create(Folder.MAPS, folder, level + Extension.LEVEL);
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/Music.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
import java.util.Locale; import com.b3dgs.lionengine.Check; import com.b3dgs.lionengine.LionEngineException; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.warcraft.constant.Extension; import com.b3dgs.warcraft.constant.Folder;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
final String file = name().toLowerCase(Locale.ENGLISH) + Extension.MUSIC;
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/Music.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
import java.util.Locale; import com.b3dgs.lionengine.Check; import com.b3dgs.lionengine.LionEngineException; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.warcraft.constant.Extension; import com.b3dgs.warcraft.constant.Folder;
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/constant/Extension.java // public final class Extension // { // /** Image file extension (with dot). */ // public static final String IMAGE = ".png"; // /** Levels file extension (with dot). */ // public static final String LEVEL = ".wrl"; //...
media = Medias.create(Folder.MUSICS, folder, file.substring(race.name().length() + 1));
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/Decayable.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
import com.b3dgs.lionengine.AnimState; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.lionengine.Tick; import com.b3dgs.lionengine.Updatable; import com.b3dgs.lionengine.game.feature.Animatable; import com.b3dgs.lionengine.game.feature.FeatureGet; import com.b3dgs.lioneng...
checkCorpse = extrp -> { tick.update(extrp); if (tick.elapsed(delay)) { spawner.spawn(media, transformable) .getFeature(Effect.class) .start(transformable.getWidth(), transformable.getHeight()); ...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
return stateHandler.isState(StateDead.class)
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/Decayable.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
import com.b3dgs.lionengine.AnimState; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.lionengine.Tick; import com.b3dgs.lionengine.Updatable; import com.b3dgs.lionengine.game.feature.Animatable; import com.b3dgs.lionengine.game.feature.FeatureGet; import com.b3dgs.lioneng...
checkCorpse = extrp -> { tick.update(extrp); if (tick.elapsed(delay)) { spawner.spawn(media, transformable) .getFeature(Effect.class) .start(transformable.getWidth(), transformable.getHeight()); ...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
|| stateHandler.isState(StateDeadGold.class)
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/Decayable.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
import com.b3dgs.lionengine.AnimState; import com.b3dgs.lionengine.Media; import com.b3dgs.lionengine.Medias; import com.b3dgs.lionengine.Tick; import com.b3dgs.lionengine.Updatable; import com.b3dgs.lionengine.game.feature.Animatable; import com.b3dgs.lionengine.game.feature.FeatureGet; import com.b3dgs.lioneng...
{ tick.update(extrp); if (tick.elapsed(delay)) { spawner.spawn(media, transformable) .getFeature(Effect.class) .start(transformable.getWidth(), transformable.getHeight()); pathfindable.clearP...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java // public class StateDead extends State // { // /** // * Create the state. // * // * @param model The model reference. // * @param animation The animation reference. // */ // StateDead(EntityMod...
|| stateHandler.isState(StateDeadWood.class);
b3dgs/warcraft-remake
warcraft-game/src/main/java/com/b3dgs/warcraft/action/Attack.java
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
import java.util.List; import com.b3dgs.lionengine.game.feature.Services; import com.b3dgs.lionengine.game.feature.Setup; import com.b3dgs.lionengine.game.feature.Transformable; import com.b3dgs.lionengine.game.feature.attackable.Attacker; import com.b3dgs.lionengine.game.feature.collidable.selector.Selectable; i...
/* * Copyright (C) 2013-2022 Byron 3D Games Studio (www.b3dgs.com) Pierre-Alexandre (contact@b3dgs.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Licen...
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/EntitySfx.java // @FeatureInterface // public class EntitySfx extends FeatureModel // { // private static final String ATT_STARTED = "started"; // private static final String ATT_PRODUCED = "produced"; // private static final String...
selectable.getFeature(EntitySfx.class).onOrdered();
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/config/WebConfig.java
// Path: spat-services/src/main/java/com/pcalouche/spat/interceptors/LoggerInterceptor.java // @Component // public class LoggerInterceptor extends HandlerInterceptorAdapter { // private static final Logger logger = LoggerFactory.getLogger(LoggerInterceptor.class); // // @Override // public boolean preHand...
import com.pcalouche.spat.interceptors.LoggerInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annota...
package com.pcalouche.spat.config; @Configuration public class WebConfig implements WebMvcConfigurer { private final SpatProperties spatProperties;
// Path: spat-services/src/main/java/com/pcalouche/spat/interceptors/LoggerInterceptor.java // @Component // public class LoggerInterceptor extends HandlerInterceptorAdapter { // private static final Logger logger = LoggerFactory.getLogger(LoggerInterceptor.class); // // @Override // public boolean preHand...
private final LoggerInterceptor loggerInterceptor;
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/api/controller/TeamControllerTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
import com.pcalouche.spat.AbstractControllerTest; import com.pcalouche.spat.api.EndpointMessages; import com.pcalouche.spat.api.Endpoints; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.service.TeamService; import org.junit.jupiter.api.BeforeEach;...
package com.pcalouche.spat.api.controller; @WebMvcTest(TeamController.class) public class TeamControllerTest extends AbstractControllerTest { @MockBean
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
private TeamService teamService;
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/api/controller/TeamControllerTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
import com.pcalouche.spat.AbstractControllerTest; import com.pcalouche.spat.api.EndpointMessages; import com.pcalouche.spat.api.Endpoints; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.service.TeamService; import org.junit.jupiter.api.BeforeEach;...
package com.pcalouche.spat.api.controller; @WebMvcTest(TeamController.class) public class TeamControllerTest extends AbstractControllerTest { @MockBean private TeamService teamService;
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
private TeamDto testTeamDto1;
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/api/controller/TeamControllerTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
import com.pcalouche.spat.AbstractControllerTest; import com.pcalouche.spat.api.EndpointMessages; import com.pcalouche.spat.api.Endpoints; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.service.TeamService; import org.junit.jupiter.api.BeforeEach;...
package com.pcalouche.spat.api.controller; @WebMvcTest(TeamController.class) public class TeamControllerTest extends AbstractControllerTest { @MockBean private TeamService teamService; private TeamDto testTeamDto1; private TeamDto testTeamDto2; @BeforeEach public void before() { tes...
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractControllerTest.java // @ExtendWith(SpringExtension.class) // @Import({ // SpatProperties.class, // SecurityUtils.class, // SecurityConfig.class // }) // public abstract class AbstractControllerTest { // @Autowired // protect...
mockMvc.perform(MockMvcRequestBuilders.get(Endpoints.TEAMS)
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/service/TeamServiceTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
import com.pcalouche.spat.AbstractServiceTest; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org....
package com.pcalouche.spat.service; public class TeamServiceTest extends AbstractServiceTest { @Autowired
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
private TeamRepository teamRepository;
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/service/TeamServiceTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
import com.pcalouche.spat.AbstractServiceTest; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org....
package com.pcalouche.spat.service; public class TeamServiceTest extends AbstractServiceTest { @Autowired private TeamRepository teamRepository; private TeamService teamService;
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
private Team team1;
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/service/TeamServiceTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
import com.pcalouche.spat.AbstractServiceTest; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org....
package com.pcalouche.spat.service; public class TeamServiceTest extends AbstractServiceTest { @Autowired private TeamRepository teamRepository; private TeamService teamService; private Team team1; private Team team2; @BeforeEach public void before() { teamService = new TeamServ...
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
TeamDto.builder()
pcalouche/spat
spat-services/src/test/java/com/pcalouche/spat/service/TeamServiceTest.java
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
import com.pcalouche.spat.AbstractServiceTest; import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org....
public void testFindByName() { assertThat(teamService.findByName(team1.getName())) .isEqualTo( Optional.of( TeamDto.builder() .id(team1.getId()) .name("Team...
// Path: spat-services/src/test/java/com/pcalouche/spat/AbstractServiceTest.java // @ExtendWith(SpringExtension.class) // @DataJpaTest // public abstract class AbstractServiceTest { // } // // Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllAr...
TeamEditRequest teamEditRequest = TeamEditRequest.builder()
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/security/util/SecurityUtils.java
// Path: spat-services/src/main/java/com/pcalouche/spat/config/SpatProperties.java // @Getter // @Setter // @Component // @ConfigurationProperties(prefix = "spat") // @Validated // public class SpatProperties { // /** // * The current version. This is set use Spring Boot's automatic // * property expansio...
import com.pcalouche.spat.config.SpatProperties; import com.pcalouche.spat.entity.User; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.security.Keys; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseCookie; import org.springframework.security.authe...
package com.pcalouche.spat.security.util; @Component public class SecurityUtils { public static final PasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder(); public static final String[] WHITELISTED_ENDPOINTS = { // swagger endpoints "/", "/csrf", "/err...
// Path: spat-services/src/main/java/com/pcalouche/spat/config/SpatProperties.java // @Getter // @Setter // @Component // @ConfigurationProperties(prefix = "spat") // @Validated // public class SpatProperties { // /** // * The current version. This is set use Spring Boot's automatic // * property expansio...
private final SpatProperties spatProperties;
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/security/util/SecurityUtils.java
// Path: spat-services/src/main/java/com/pcalouche/spat/config/SpatProperties.java // @Getter // @Setter // @Component // @ConfigurationProperties(prefix = "spat") // @Validated // public class SpatProperties { // /** // * The current version. This is set use Spring Boot's automatic // * property expansio...
import com.pcalouche.spat.config.SpatProperties; import com.pcalouche.spat.entity.User; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.security.Keys; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseCookie; import org.springframework.security.authe...
if (spatProperties.getJwtTokenDuration().compareTo(spatProperties.getRefreshTokenDuration()) > 0) { throw new IllegalArgumentException("jwt token duration cannot be greater than refresh token duration"); } this.spatProperties = spatProperties; this.secretKey = Keys.hmacShaKey...
// Path: spat-services/src/main/java/com/pcalouche/spat/config/SpatProperties.java // @Getter // @Setter // @Component // @ConfigurationProperties(prefix = "spat") // @Validated // public class SpatProperties { // /** // * The current version. This is set use Spring Boot's automatic // * property expansio...
public static void validateUserAccountStatus(User user) {
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/service/TeamServiceImpl.java
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.ann...
package com.pcalouche.spat.service; @Service public class TeamServiceImpl implements TeamService {
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
private final TeamRepository teamRepository;
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/service/TeamServiceImpl.java
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.ann...
package com.pcalouche.spat.service; @Service public class TeamServiceImpl implements TeamService { private final TeamRepository teamRepository; public TeamServiceImpl(TeamRepository teamRepository) { this.teamRepository = teamRepository; } @Override @Transactional(readOnly = true)
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
public Optional<TeamDto> findById(Integer id) {
pcalouche/spat
spat-services/src/main/java/com/pcalouche/spat/service/TeamServiceImpl.java
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
import com.pcalouche.spat.api.dto.TeamDto; import com.pcalouche.spat.api.dto.TeamEditRequest; import com.pcalouche.spat.entity.Team; import com.pcalouche.spat.repository.TeamRepository; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.ann...
package com.pcalouche.spat.service; @Service public class TeamServiceImpl implements TeamService { private final TeamRepository teamRepository; public TeamServiceImpl(TeamRepository teamRepository) { this.teamRepository = teamRepository; } @Override @Transactional(readOnly = true) p...
// Path: spat-services/src/main/java/com/pcalouche/spat/api/dto/TeamDto.java // @Data // @Builder // @NoArgsConstructor // @AllArgsConstructor // public class TeamDto { // @EqualsAndHashCode.Exclude // private Integer id; // private String name; // // public static TeamDto map(Team team) { // r...
public TeamDto create(TeamEditRequest teamEditRequest) {