This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profile> | |
<id>appConfigTest</id> | |
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<configuration combine.self="override"> | |
<groups>appConfigTest</groups> | |
</configuration> | |
</plugin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package no.vegvesen.kjoretoy.registrering.register.web; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.Table; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.springframework.beans.factory.InitializingBean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimingExtension implements AfterAllCallback, TestInstancePostProcessor { | |
private static final Logger logger = Logger.getLogger(TimingExtension.class.getName()); | |
private static final String START_TIME = "start time"; | |
@Override | |
public void postProcessTestInstance(Object testInstance, ExtensionContext context) { | |
getStore(context).put(START_TIME, System.currentTimeMillis()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.Table; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.springframework.beans.factory.InitializingBean; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.stereotype.Service; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>flatten-maven-plugin</artifactId> | |
<configuration> | |
<updatePomFile>true</updatePomFile> | |
<outputDirectory>${project.build.directory}</outputDirectory> | |
<pomElements> | |
<repositories>remove</repositories> | |
</pomElements> | |
</configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package no.vegvesen.kjoretoy.registrering.forhandler.web.config; | |
import java.util.concurrent.Executor; | |
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Import; | |
import org.springframework.core.task.SimpleAsyncTaskExecutor; | |
import org.springframework.scheduling.annotation.AsyncConfigurer; | |
import org.springframework.scheduling.annotation.EnableAsync; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String readContentFromFileInJarOnClasspath() { | |
try { | |
return StreamUtils.copyToString(new ClassPathResource("/lol.txt").getInputStream(), Charset.defaultCharset()); | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DateTimeFormatter timeFormatter = new DateTimeFormatterBuilder() | |
.appendValue(HOUR_OF_DAY, 2) | |
.appendLiteral(':') | |
.appendValue(MINUTE_OF_HOUR, 2) | |
.optionalStart() | |
.appendLiteral(':') | |
.appendValue(SECOND_OF_MINUTE, 2) | |
.toFormatter(); | |
return LocalTime.now().format(timeFormatter); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Method; | |
import java.util.logging.Logger; | |
import org.junit.jupiter.api.extension.AfterTestExecutionCallback; | |
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; | |
import org.junit.jupiter.api.extension.ExtensionContext; | |
import org.junit.jupiter.api.extension.ExtensionContext.Namespace; | |
import org.junit.jupiter.api.extension.ExtensionContext.Store; | |
public class TimingExtension implements BeforeTestExecutionCallback, AfterTestExecutionCallback { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); |