Merge branch 'master' into JAVA-11196-split-httpclient-module
This commit is contained in:
@@ -12,3 +12,4 @@ This module contains articles about parsing and formatting Java date and time ob
|
||||
- [Convert between String and Timestamp](https://www.baeldung.com/java-string-to-timestamp)
|
||||
- [Convert String to Date in Java](http://www.baeldung.com/java-string-to-date)
|
||||
- [Format a Milliseconds Duration to HH:MM:SS](https://www.baeldung.com/java-ms-to-hhmmss)
|
||||
- [Format Instant to String in Java](https://www.baeldung.com/java-instant-to-string)
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.baeldung.implementsvsextends;
|
||||
|
||||
import com.baeldung.implementsvsextends.media.model.AudioMedia;
|
||||
import com.baeldung.implementsvsextends.media.model.Media;
|
||||
import com.baeldung.implementsvsextends.media.model.VideoMedia;
|
||||
import com.baeldung.implementsvsextends.media.player.impl.AudioMediaPlayer;
|
||||
import com.baeldung.implementsvsextends.media.player.impl.CustomMediaPlayer;
|
||||
import com.baeldung.implementsvsextends.media.player.impl.MultiMediaPlayer;
|
||||
import com.baeldung.implementsvsextends.media.player.impl.VideoMediaPlayer;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Media media = new Media();
|
||||
media.setId(001);
|
||||
media.setTitle("Media1");
|
||||
media.setArtist("Artist001");
|
||||
|
||||
AudioMedia audioMedia = new AudioMedia();
|
||||
audioMedia.setId(101);
|
||||
audioMedia.setTitle("Audio1");
|
||||
audioMedia.setArtist("Artist101");
|
||||
audioMedia.setBitrate(3500);
|
||||
audioMedia.setFrequency("256kbps");
|
||||
|
||||
VideoMedia videoMedia = new VideoMedia();
|
||||
videoMedia.setId(201);
|
||||
videoMedia.setTitle("Video1");
|
||||
videoMedia.setArtist("Artist201");
|
||||
videoMedia.setResolution("1024x768");
|
||||
videoMedia.setAspectRatio("16:9");
|
||||
|
||||
System.out.println(media);
|
||||
System.out.println(audioMedia);
|
||||
System.out.println(videoMedia);
|
||||
|
||||
AudioMediaPlayer audioMediaPlayer = new AudioMediaPlayer();
|
||||
audioMediaPlayer.play();
|
||||
audioMediaPlayer.pause();
|
||||
|
||||
VideoMediaPlayer videoMediaPlayer = new VideoMediaPlayer();
|
||||
videoMediaPlayer.play();
|
||||
videoMediaPlayer.pause();
|
||||
|
||||
MultiMediaPlayer multiMediaPlayer = new MultiMediaPlayer();
|
||||
multiMediaPlayer.play();
|
||||
multiMediaPlayer.pause();
|
||||
multiMediaPlayer.seek();
|
||||
multiMediaPlayer.fastForward();
|
||||
|
||||
CustomMediaPlayer customMediaPlayer = new CustomMediaPlayer();
|
||||
customMediaPlayer.play();
|
||||
customMediaPlayer.pause();
|
||||
customMediaPlayer.setId(301);
|
||||
customMediaPlayer.setTitle("Custom1");
|
||||
customMediaPlayer.setArtist("Artist301");
|
||||
System.out.println(customMediaPlayer);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.baeldung.implementsvsextends.media.model;
|
||||
|
||||
public class AudioMedia extends Media {
|
||||
|
||||
private int bitrate;
|
||||
|
||||
private String frequency;
|
||||
|
||||
@Override
|
||||
public void printTitle() {
|
||||
System.out.println("AudioMedia Title");
|
||||
}
|
||||
|
||||
public int getBitrate() {
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
public void setBitrate(int bitrate) {
|
||||
this.bitrate = bitrate;
|
||||
}
|
||||
|
||||
public String getFrequency() {
|
||||
return frequency;
|
||||
}
|
||||
|
||||
public void setFrequency(String frequency) {
|
||||
this.frequency = frequency;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AudioMedia{" +
|
||||
"id=" + this.getId() +
|
||||
", title='" + this.getTitle() + '\'' +
|
||||
", artist='" + this.getArtist() + '\'' +
|
||||
", bitrate=" + bitrate +
|
||||
", frequency='" + frequency + '\'' +
|
||||
"} ";
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.baeldung.implementsvsextends.media.model;
|
||||
|
||||
public class Media {
|
||||
|
||||
private int id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String artist;
|
||||
|
||||
public void printTitle() {
|
||||
System.out.println("Media Title");
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
public void setArtist(String artist) {
|
||||
this.artist = artist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Media{" +
|
||||
"id=" + id +
|
||||
", title='" + title + '\'' +
|
||||
", artist='" + artist + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.baeldung.implementsvsextends.media.model;
|
||||
|
||||
public class VideoMedia extends Media {
|
||||
|
||||
private String resolution;
|
||||
|
||||
private String aspectRatio;
|
||||
|
||||
public String getResolution() {
|
||||
return resolution;
|
||||
}
|
||||
|
||||
public void setResolution(String resolution) {
|
||||
this.resolution = resolution;
|
||||
}
|
||||
|
||||
public String getAspectRatio() {
|
||||
return aspectRatio;
|
||||
}
|
||||
|
||||
public void setAspectRatio(String aspectRatio) {
|
||||
this.aspectRatio = aspectRatio;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VideoMedia{" +
|
||||
"id=" + this.getId() +
|
||||
", title='" + this.getTitle() + '\'' +
|
||||
", artist='" + this.getArtist() + '\'' +
|
||||
"resolution='" + resolution + '\'' +
|
||||
", aspectRatio='" + aspectRatio + '\'' +
|
||||
"} ";
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.implementsvsextends.media.player;
|
||||
|
||||
public interface AdvancedPlayerOptions {
|
||||
|
||||
void seek();
|
||||
|
||||
void fastForward();
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.implementsvsextends.media.player;
|
||||
|
||||
public interface MediaPlayer {
|
||||
|
||||
void play();
|
||||
|
||||
void pause();
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import com.baeldung.implementsvsextends.media.player.MediaPlayer;
|
||||
|
||||
public class AudioMediaPlayer implements MediaPlayer {
|
||||
|
||||
@Override
|
||||
public void play() {
|
||||
System.out.println("AudioMediaPlayer is Playing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
System.out.println("AudioMediaPlayer is Paused");
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import com.baeldung.implementsvsextends.media.model.Media;
|
||||
import com.baeldung.implementsvsextends.media.player.MediaPlayer;
|
||||
|
||||
public class CustomMediaPlayer extends Media implements MediaPlayer {
|
||||
|
||||
@Override
|
||||
public void play() {
|
||||
System.out.println("CustomMediaPlayer is Playing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
System.out.println("CustomMediaPlayer is Paused");
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import com.baeldung.implementsvsextends.media.player.AdvancedPlayerOptions;
|
||||
import com.baeldung.implementsvsextends.media.player.MediaPlayer;
|
||||
|
||||
public class MultiMediaPlayer implements MediaPlayer, AdvancedPlayerOptions {
|
||||
|
||||
@Override
|
||||
public void play() {
|
||||
System.out.println("MultiMediaPlayer is Playing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
System.out.println("MultiMediaPlayer is Paused");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seek() {
|
||||
System.out.println("MultiMediaPlayer is being seeked");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fastForward() {
|
||||
System.out.println("MultiMediaPlayer is being fast forwarded");
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import com.baeldung.implementsvsextends.media.player.MediaPlayer;
|
||||
|
||||
public class VideoMediaPlayer implements MediaPlayer {
|
||||
|
||||
@Override
|
||||
public void play() {
|
||||
System.out.println("VideoMediaPlayer is Playing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() {
|
||||
System.out.println("VideoMediaPlayer is Paused");
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.implementsvsextends.media.model;
|
||||
|
||||
import org.hamcrest.CoreMatchers;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AudioMediaUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenAudioMediaInstance_whenCheckedType_thenIsInstanceOfMedia() {
|
||||
AudioMedia audioMedia = new AudioMedia();
|
||||
Assert.assertThat(audioMedia, CoreMatchers.<AudioMedia>instanceOf(Media.class));
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.implementsvsextends.media.model;
|
||||
|
||||
import org.hamcrest.CoreMatchers;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class VideoMediaUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenVideoMediaInstance_whenCheckedType_thenIsInstanceOfMedia() {
|
||||
VideoMedia videoMedia = new VideoMedia();
|
||||
Assert.assertThat(videoMedia, CoreMatchers.<VideoMedia>instanceOf(Media.class));
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
public class AudioMediaPlayerUnitTest {
|
||||
|
||||
private final PrintStream standardOut = System.out;
|
||||
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
System.setOut(new PrintStream(outputStreamCaptor));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
System.setOut(standardOut);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAudioMediaPlayer_whenPlay_thenPrintsPlayingString() {
|
||||
AudioMediaPlayer audioMediaPlayer = new AudioMediaPlayer();
|
||||
audioMediaPlayer.play();
|
||||
Assert.assertEquals("AudioMediaPlayer is Playing", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAudioMediaPlayer_whenPause_thenPrintsPausedString() {
|
||||
AudioMediaPlayer audioMediaPlayer = new AudioMediaPlayer();
|
||||
audioMediaPlayer.pause();
|
||||
Assert.assertEquals("AudioMediaPlayer is Paused", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
public class MultiMediaPlayerUnitTest {
|
||||
|
||||
private final PrintStream standardOut = System.out;
|
||||
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
System.setOut(new PrintStream(outputStreamCaptor));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
System.setOut(standardOut);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenMultiMediaPlayer_whenPlay_thenPrintsPlayingString() {
|
||||
MultiMediaPlayer multiMediaPlayer = new MultiMediaPlayer();
|
||||
multiMediaPlayer.play();
|
||||
Assert.assertEquals("MultiMediaPlayer is Playing", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenMultiMediaPlayer_whenPause_thenPrintsPausedString() {
|
||||
MultiMediaPlayer multiMediaPlayer = new MultiMediaPlayer();
|
||||
multiMediaPlayer.pause();
|
||||
Assert.assertEquals("MultiMediaPlayer is Paused", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenMultiMediaPlayer_whenSeek_thenPrintsPausedString() {
|
||||
MultiMediaPlayer multiMediaPlayer = new MultiMediaPlayer();
|
||||
multiMediaPlayer.seek();
|
||||
Assert.assertEquals("MultiMediaPlayer is being seeked", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenMultiMediaPlayer_whenFastForward_thenPrintsPausedString() {
|
||||
MultiMediaPlayer multiMediaPlayer = new MultiMediaPlayer();
|
||||
multiMediaPlayer.fastForward();
|
||||
Assert.assertEquals("MultiMediaPlayer is being fast forwarded",
|
||||
outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.baeldung.implementsvsextends.media.player.impl;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
public class VideoMediaPlayerUnitTest {
|
||||
|
||||
private final PrintStream standardOut = System.out;
|
||||
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
System.setOut(new PrintStream(outputStreamCaptor));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
System.setOut(standardOut);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenVideoMediaPlayer_whenPlay_thenPrintsPlayingString() {
|
||||
VideoMediaPlayer videoMediaPlayer = new VideoMediaPlayer();
|
||||
videoMediaPlayer.play();
|
||||
Assert.assertEquals("VideoMediaPlayer is Playing", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenVideoMediaPlayer_whenPause_thenPrintsPausedString() {
|
||||
VideoMediaPlayer videoMediaPlayer = new VideoMediaPlayer();
|
||||
videoMediaPlayer.pause();
|
||||
Assert.assertEquals("VideoMediaPlayer is Paused", outputStreamCaptor.toString()
|
||||
.trim());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
### Relevant Articles:
|
||||
- [Send a SOAP Object with Feign Client](https://www.baeldung.com/java-feign-send-soap)
|
||||
@@ -4,14 +4,14 @@ This module contains articles about HTTPClient that are part of the HTTPClient E
|
||||
|
||||
### Relevant Articles
|
||||
|
||||
- [HttpClient 4 – Get the Status Code](https://www.baeldung.com/httpclient-status-code)
|
||||
- [HttpClient with SSL](https://www.baeldung.com/httpclient-ssl)
|
||||
- [HttpClient Timeout](https://www.baeldung.com/httpclient-timeout)
|
||||
- [HttpClient 4 – Send Custom Cookie](https://www.baeldung.com/httpclient-4-cookies)
|
||||
- [Custom HTTP Header with the HttpClient](https://www.baeldung.com/httpclient-custom-http-header)
|
||||
- [HttpClient Basic Authentication](https://www.baeldung.com/httpclient-4-basic-authentication)
|
||||
- [Posting with HttpClient](https://www.baeldung.com/httpclient-post-http-request)
|
||||
- [Adding Parameters to HttpClient Requests](https://www.baeldung.com/apache-httpclient-parameters)
|
||||
- [Apache HttpClient – Get the Status Code](https://www.baeldung.com/httpclient-status-code)
|
||||
- [Apache HttpClient with SSL](https://www.baeldung.com/httpclient-ssl)
|
||||
- [Apache HttpClient Timeout](https://www.baeldung.com/httpclient-timeout)
|
||||
- [Apache HttpClient – Send Custom Cookie](https://www.baeldung.com/httpclient-cookies)
|
||||
- [Custom HTTP Header with the Apache HttpClient](https://www.baeldung.com/httpclient-custom-http-header)
|
||||
- [Apache HttpClient Basic Authentication](https://www.baeldung.com/httpclient-basic-authentication)
|
||||
- [Posting with Apache HttpClient](https://www.baeldung.com/httpclient-post-http-request)
|
||||
- [Adding Parameters to Apache HttpClient Requests](https://www.baeldung.com/apache-httpclient-parameters)
|
||||
|
||||
|
||||
### Running the Tests
|
||||
|
||||
@@ -7,15 +7,14 @@ This module contains articles about HttpClient 4.x
|
||||
The "REST With Spring" Classes: http://bit.ly/restwithspring
|
||||
|
||||
### Relevant Articles:
|
||||
|
||||
- [HttpClient 4 – Cancel Request](https://www.baeldung.com/httpclient-cancel-request)
|
||||
- [HttpClient 4 Cookbook](https://www.baeldung.com/httpclient4)
|
||||
- [HttpClient 4 – Follow Redirects for POST](https://www.baeldung.com/httpclient-redirect-on-http-post)
|
||||
- [Multipart Upload with HttpClient 4](https://www.baeldung.com/httpclient-multipart-upload)
|
||||
- [HttpAsyncClient Tutorial](https://www.baeldung.com/httpasyncclient-tutorial)
|
||||
- [HttpClient 4 Tutorial](https://www.baeldung.com/httpclient-guide)
|
||||
- [Apache HttpClient – Cancel Request](https://www.baeldung.com/httpclient-cancel-request)
|
||||
- [Apache HttpClient 4 Cookbook](https://www.baeldung.com/httpclient4)
|
||||
- [Apache HttpClient – Follow Redirects for POST](https://www.baeldung.com/httpclient-redirect-on-http-post)
|
||||
- [Multipart Upload with Apache HttpClient](https://www.baeldung.com/httpclient-multipart-upload)
|
||||
- [Apache HttpAsyncClient Tutorial](https://www.baeldung.com/httpasyncclient-tutorial)
|
||||
- [Apache HttpClient Tutorial](https://www.baeldung.com/httpclient-guide)
|
||||
- [Advanced HttpClient Configuration](https://www.baeldung.com/httpclient-advanced-config)
|
||||
- [HttpClient 4 – Do Not Follow Redirects](https://www.baeldung.com/httpclient-stop-follow-redirect)
|
||||
- [Custom User-Agent in HttpClient 4](https://www.baeldung.com/httpclient-user-agent-header)
|
||||
- [Apache HttpClient – Do Not Follow Redirects](https://www.baeldung.com/httpclient-stop-follow-redirect)
|
||||
- [Custom User-Agent in Apache HttpClient](https://www.baeldung.com/httpclient-user-agent-header)
|
||||
- [Apache HttpClient Connection Management](https://www.baeldung.com/httpclient-connection-management)
|
||||
- More articles: [[next -->]](../httpclient-2)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
## JTA
|
||||
|
||||
This module contains articles about the Java Transaction API (JTA).
|
||||
|
||||
### Relevant Articles:
|
||||
- [Guide to Jakarta EE JTA](https://www.baeldung.com/jee-jta)
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jta</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>jta</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>JEE JTA demo</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-bom</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jta-bitronix</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<spring-boot.version>2.4.7</spring-boot.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="15 seconds" debug="false">
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>[%d{ISO8601}]-[%thread] %-5level %logger - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -16,4 +16,5 @@ Remember, for advanced libraries like [Jackson](/jackson) and [JUnit](/testing-m
|
||||
- [Introduction to Takes](https://www.baeldung.com/java-takes)
|
||||
- [Using NullAway to Avoid NullPointerExceptions](https://www.baeldung.com/java-nullaway)
|
||||
- [Introduction to Alibaba Arthas](https://www.baeldung.com/java-alibaba-arthas-intro)
|
||||
- More articles [[<-- prev]](/libraries-2) [[next -->]](/libraries-4)
|
||||
- [Introduction to Structurizr](https://www.baeldung.com/structurizr)
|
||||
- More articles [[<-- prev]](../libraries-2) [[next -->]](../libraries-4)
|
||||
|
||||
+29
-2
@@ -86,6 +86,32 @@
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
<version>${errorprone.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.structurizr</groupId>
|
||||
<artifactId>structurizr-core</artifactId>
|
||||
<version>${structurizr.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.structurizr</groupId>
|
||||
<artifactId>structurizr-spring</artifactId>
|
||||
<version>${structurizr.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.structurizr</groupId>
|
||||
<artifactId>structurizr-client</artifactId>
|
||||
<version>${structurizr.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.structurizr</groupId>
|
||||
<artifactId>structurizr-analysis</artifactId>
|
||||
<version>${structurizr.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.structurizr</groupId>
|
||||
<artifactId>structurizr-plantuml</artifactId>
|
||||
<version>${structurizr.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
@@ -140,7 +166,7 @@
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<compilerArgs>
|
||||
<!-- NullAway will warn by default, uncomment the next line to make the build
|
||||
<!-- NullAway will warn by default, uncomment the next line to make the build
|
||||
fail -->
|
||||
<!-- <arg>-Xep:NullAway:ERROR</arg> -->
|
||||
<arg>-XepExcludedPaths:(.*)/test/.*|(.*)/jcabi/.*</arg>
|
||||
@@ -153,7 +179,7 @@
|
||||
<artifactId>plexus-compiler-javac-errorprone</artifactId>
|
||||
<version>2.8</version>
|
||||
</dependency>
|
||||
<!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the
|
||||
<!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the
|
||||
latest version -->
|
||||
<dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
@@ -229,6 +255,7 @@
|
||||
<nullaway.version>0.3.0</nullaway.version>
|
||||
<plexus-compiler.version>2.8</plexus-compiler.version>
|
||||
<errorprone.version>2.1.3</errorprone.version>
|
||||
<structurizr.version>1.0.0</structurizr.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+6
-6
@@ -1,10 +1,5 @@
|
||||
package com.baeldung.structurizr;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.structurizr.Workspace;
|
||||
import com.structurizr.analysis.ComponentFinder;
|
||||
import com.structurizr.analysis.ReferencedTypesSupportingTypesStrategy;
|
||||
@@ -27,6 +22,11 @@ import com.structurizr.view.SystemContextView;
|
||||
import com.structurizr.view.View;
|
||||
import com.structurizr.view.ViewSet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class StructurizrSimple {
|
||||
|
||||
public static final String PAYMENT_TERMINAL = "Payment Terminal";
|
||||
@@ -51,7 +51,7 @@ public class StructurizrSimple {
|
||||
addStyles(workspace.getViews());
|
||||
//uploadToExternal(workspace);
|
||||
}
|
||||
|
||||
|
||||
private static View findViewWithKey(ViewSet viewSet, String key) {
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("A key must be specified.");
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user