File tree Expand file tree Collapse file tree
src/test/java/com/baeldung/stringtoboolean Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ * .class
2+
3+ 0. *
4+
5+ # folders#
6+ /target
7+ /neoDb *
8+ /data
9+ /src /main /webapp /WEB-INF /classes
10+ * /META-INF /*
11+ .resourceCache
12+
13+ # Packaged files #
14+ * .jar
15+ * .war
16+ * .ear
17+
18+ # Files generated by integration tests
19+ backup-pom.xml
20+ /bin /
21+ /temp
22+
23+ # IntelliJ specific
24+ .idea /
25+ * .iml
Original file line number Diff line number Diff line change 1+ ## Core Java Lang (Part 3)
2+
3+ This module contains articles about core features in the Java language
4+
5+ ### Relevant Articles:
6+ - [[ <-- Prev]] ( /core-java-modules/core-java-lang-2 )
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5+ <parent >
6+ <groupId >com.baeldung.core-java-modules</groupId >
7+ <artifactId >core-java-modules</artifactId >
8+ <version >0.0.1-SNAPSHOT</version >
9+ <relativePath >../</relativePath >
10+ </parent >
11+ <modelVersion >4.0.0</modelVersion >
12+
13+ <artifactId >core-java-lang-3</artifactId >
14+
15+ <dependencies >
16+ <dependency >
17+ <groupId >org.assertj</groupId >
18+ <artifactId >assertj-core</artifactId >
19+ <version >${assertj.version} </version >
20+ <scope >test</scope >
21+ </dependency >
22+ </dependencies >
23+
24+ <build >
25+ <finalName >core-java-lang-3</finalName >
26+ <resources >
27+ <resource >
28+ <directory >src/main/resources</directory >
29+ <filtering >true</filtering >
30+ </resource >
31+ </resources >
32+ </build >
33+
34+ <properties >
35+ <assertj .version>3.12.2</assertj .version>
36+ </properties >
37+ </project >
Original file line number Diff line number Diff line change 1+ package com .baeldung .stringtoboolean ;
2+
3+ import static org .assertj .core .api .Assertions .assertThat ;
4+
5+ import org .junit .Test ;
6+
7+ public class StringToBooleanUnitTest
8+ {
9+ @ Test
10+ public void givenStringTrue_whenUsingParseBoolean_thenTrue () {
11+ assertThat (Boolean .parseBoolean ("true" )).isTrue ();
12+ }
13+
14+ @ Test
15+ public void givenStringTrue_whenUsingValueOf_thenTrue () {
16+ assertThat (Boolean .valueOf ("true" )).isTrue ();
17+ }
18+
19+ @ Test
20+ public void givenStringTrue_whenUsingGetBoolean_thenFalse () {
21+ assertThat (Boolean .getBoolean ("true" )).isFalse ();
22+ }
23+
24+ @ Test
25+ public void givenSystemProperty_whenUsingGetBoolean_thenTrue () {
26+ System .setProperty ("CODING_IS_FUN" , "true" );
27+ assertThat (Boolean .getBoolean ("CODING_IS_FUN" )).isTrue ();
28+ }
29+ }
Original file line number Diff line number Diff line change 131131
132132 <!-- <module>multimodulemavenproject</module> --> <!-- We haven't upgraded to java 9. Fixing in BAEL-10841 -->
133133 <module >pre-jpms</module >
134+ <module >core-java-lang-3</module >
134135 </modules >
135136
136137 <build >
You can’t perform that action at this time.
0 commit comments