Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
1d5cddc1
Commit
1d5cddc1
authored
Apr 30, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish gemfire sample
parent
2c087d47
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
118 deletions
+99
-118
pom.xml
spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
+1
-1
SampleDataGemFireApplication.java
...ava/sample/data/gemfire/SampleDataGemFireApplication.java
+4
-10
Gemstone.java
...re/src/main/java/sample/data/gemfire/domain/Gemstone.java
+7
-11
GemstoneRepository.java
.../java/sample/data/gemfire/service/GemstoneRepository.java
+4
-8
GemstoneService.java
...ain/java/sample/data/gemfire/service/GemstoneService.java
+5
-17
GemstoneServiceImpl.java
...java/sample/data/gemfire/service/GemstoneServiceImpl.java
+36
-29
spring-data-gemfire-cache.xml
...-gemfire/src/main/resources/spring-data-gemfire-cache.xml
+10
-10
SampleDataGemFireApplicationTest.java
...sample/data/gemfire/SampleDataGemFireApplicationTest.java
+32
-32
No files found.
spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
View file @
1d5cddc1
<?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"
>
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>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java
View file @
1d5cddc1
...
...
@@ -25,17 +25,12 @@ import org.springframework.data.gemfire.repository.config.EnableGemfireRepositor
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* The GemstoneAppConfiguration class for allowing Spring Boot to pickup additional application Spring configuration
* meta-data for GemFire, which must be specified in Spring Data GemFire's XML namespace.
* The GemstoneAppConfiguration class for allowing Spring Boot to pickup additional
* application Spring configuration meta-data for GemFire, which must be specified in
* Spring Data GemFire's XML namespace.
* <p/>
* @author John Blum
* @see org.springframework.boot.autoconfigure.EnableAutoConfiguration
* @see org.springframework.context.annotation.ComponentScan
* @see org.springframework.context.annotation.Configuration
* @see org.springframework.context.annotation.ImportResource
* @see org.springframework.data.gemfire.repository.config.EnableGemfireRepositories
* @see org.springframework.transaction.annotation.EnableTransactionManagement
* @since 1.0.0
* @since 1.1.0
*/
@Configuration
@ImportResource
(
"/spring-data-gemfire-cache.xml"
)
...
...
@@ -43,7 +38,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAutoConfiguration
@EnableGemfireRepositories
@EnableTransactionManagement
@SuppressWarnings
(
"unused"
)
public
class
SampleDataGemFireApplication
{
public
static
void
main
(
final
String
[]
args
)
{
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/domain/Gemstone.java
View file @
1d5cddc1
...
...
@@ -23,16 +23,12 @@ import org.springframework.data.gemfire.mapping.Region;
import
org.springframework.util.ObjectUtils
;
/**
* The Gemstone class is an abstract data type modeling a Gemstone, such as a diamond or a ruby.
* <p/>
* The Gemstone class is an abstract data type modeling a Gemstone, such as a diamond or a
* ruby.
*
* @author John Blum
* @see java.io.Serializable
* @see org.springframework.data.annotation.Id
* @see org.springframework.data.gemfire.mapping.Region
* @since 1.0.0
*/
@Region
(
"Gemstones"
)
@SuppressWarnings
(
"unused"
)
public
class
Gemstone
implements
Serializable
{
@Id
...
...
@@ -53,7 +49,7 @@ public class Gemstone implements Serializable {
}
public
Long
getId
()
{
return
id
;
return
this
.
id
;
}
public
void
setId
(
final
Long
id
)
{
...
...
@@ -61,7 +57,7 @@ public class Gemstone implements Serializable {
}
public
String
getName
()
{
return
name
;
return
this
.
name
;
}
public
void
setName
(
final
String
name
)
{
...
...
@@ -92,8 +88,8 @@ public class Gemstone implements Serializable {
@Override
public
String
toString
()
{
return
String
.
format
(
"{ @type = %1$s, id = %2$d, name = %3$s }"
,
getClass
()
.
getName
(),
getId
(),
getName
());
return
String
.
format
(
"{ @type = %1$s, id = %2$d, name = %3$s }"
,
getClass
()
.
getName
(),
getId
(),
getName
());
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneRepository.java
View file @
1d5cddc1
...
...
@@ -21,20 +21,16 @@ import org.springframework.data.gemfire.repository.GemfireRepository;
import
sample.data.gemfire.domain.Gemstone
;
/**
* The GemstoneRepository interface is an extension of the GemfireRepository abstraction for encapsulating data access
* and persistence operations (CRUD) on Gemstone domain objects.
* <p/>
* The GemstoneRepository interface is an extension of the GemfireRepository abstraction
* for encapsulating data access and persistence operations (CRUD) on Gemstone domain
* objects.
*
* @author John Blum
* @see org.springframework.data.gemfire.repository.GemfireRepository
* @see sample.data.gemfire.domain.Gemstone
* @since 1.0.0
*/
public
interface
GemstoneRepository
extends
GemfireRepository
<
Gemstone
,
Long
>
{
/**
* Finds a particular Gemstone in the GemFire Cache by name.
* <p/>
*
* @param <T> the Class type of the Gemstone domain object to find.
* @param name a String value indicating the name of the Gemstone to find.
* @return a Gemstone by name.
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneService.java
View file @
1d5cddc1
...
...
@@ -19,28 +19,21 @@ package sample.data.gemfire.service;
import
sample.data.gemfire.domain.Gemstone
;
/**
* The GemstoneService interface is a Service interface object contract defining business
operations for processing
* Gemstone domain objects.
*
<p/>
* The GemstoneService interface is a Service interface object contract defining business
*
operations for processing
Gemstone domain objects.
*
* @author John Blum
* @see sample.data.gemfire.domain.Gemstone
* @since 1.0.0
*/
@SuppressWarnings
(
"unused"
)
public
interface
GemstoneService
{
/**
* Returns a count of the number of Gemstones in the GemFire Cache.
* <p/>
*
* @return a long value indicating the number of Gemstones in the GemFire Cache.
*/
long
count
();
/**
* Gets a Gemstone by ID.
* <p/>
*
* @param id a long value indicating the identifier of the Gemstone.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @see sample.data.gemfire.domain.Gemstone
...
...
@@ -49,8 +42,6 @@ public interface GemstoneService {
/**
* Gets a Gemstone by name.
* <p/>
*
* @param name a String value indicating the name of the Gemstone.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @see sample.data.gemfire.domain.Gemstone
...
...
@@ -59,9 +50,8 @@ public interface GemstoneService {
/**
* Return a listing of Gemstones currently stored in the GemFire Cache.
* <p/>
*
* @return a Iterable object to iterate over the list of Gemstones currently stored in the GemFire Cache.
* @return a Iterable object to iterate over the list of Gemstones currently stored in
* the GemFire Cache.
* @see java.lang.Iterable
* @see sample.data.gemfire.domain.Gemstone
*/
...
...
@@ -69,8 +59,6 @@ public interface GemstoneService {
/**
* Saves the specified Gemstone to the GemFire Cache.
* <p/>
*
* @param gemstone the Gemstone to save in the GemFire Cache.
* @return the saved Gemstone.
* @see sample.data.gemfire.domain.Gemstone
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneServiceImpl.java
View file @
1d5cddc1
...
...
@@ -19,6 +19,7 @@ package sample.data.gemfire.service;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,102 +30,106 @@ import org.springframework.util.Assert;
import
sample.data.gemfire.domain.Gemstone
;
/**
* The GemstoneServiceImpl class is a Service object implementing the GemstoneService interface containing
* business logic and rules in addition to data services for processing Gemstones.
* <p/>
* The GemstoneServiceImpl class is a Service object implementing the GemstoneService
* interface containing business logic and rules in addition to data services for
* processing Gemstones.
*
* @author John Blum
* @see org.springframework.stereotype.Service
* @see org.springframework.transaction.annotation.Transactional
* @see sample.data.gemfire.domain.Gemstone
* @see sample.data.gemfire.service.GemstoneRepository
* @see sample.data.gemfire.service.GemstoneService
* @since 1.0.0
*/
@Service
(
"gemstoneService"
)
@SuppressWarnings
(
"unused"
)
public
class
GemstoneServiceImpl
implements
GemstoneService
{
protected
static
final
List
<
String
>
APPROVED_GEMS
=
new
ArrayList
<
String
>(
Arrays
.
asList
(
"ALEXANDRITE"
,
"AQUAMARINE"
,
"DIAMOND"
,
"OPAL"
,
"PEARL"
,
"RUBY"
,
"SAPPHIRE"
,
"SPINEL"
,
"TOPAZ"
));
protected
static
final
List
<
String
>
APPROVED_GEMS
=
new
ArrayList
<
String
>(
Arrays
.
asList
(
"ALEXANDRITE"
,
"AQUAMARINE"
,
"DIAMOND"
,
"OPAL"
,
"PEARL"
,
"RUBY"
,
"SAPPHIRE"
,
"SPINEL"
,
"TOPAZ"
));
@Autowired
private
GemstoneRepository
gemstoneRepo
;
@PostConstruct
public
void
init
()
{
Assert
.
notNull
(
gemstoneRepo
,
"A reference to the 'GemstoneRepository' was not properly configured!"
);
Assert
.
notNull
(
this
.
gemstoneRepo
,
"A reference to the 'GemstoneRepository' was not properly configured!"
);
System
.
out
.
printf
(
"%1$s initialized!%n"
,
getClass
().
getSimpleName
());
}
/**
* Returns a count of the number of Gemstones in the GemFire Cache.
* <p/>
*
*
* @return a long value indicating the number of Gemstones in the GemFire Cache.
*/
@Override
@Transactional
(
readOnly
=
true
)
public
long
count
()
{
return
gemstoneRepo
.
count
();
return
this
.
gemstoneRepo
.
count
();
}
/**
* Gets a Gemstone by ID.
* <p/>
*
*
* @param id a long value indicating the identifier of the Gemstone.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
final
Long
id
)
{
return
gemstoneRepo
.
findOne
(
id
);
return
this
.
gemstoneRepo
.
findOne
(
id
);
}
/**
* Gets a Gemstone by name.
* <p/>
*
*
* @param name a String value indicating the name of the Gemstone.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
final
String
name
)
{
return
gemstoneRepo
.
findByName
(
name
);
return
this
.
gemstoneRepo
.
findByName
(
name
);
}
/**
* Return a listing of Gemstones currently stored in the GemFire Cache.
* <p/>
*
* @return a Iterable object to iterate over the list of Gemstones currently stored in the GemFire Cache.
*
* @return a Iterable object to iterate over the list of Gemstones currently stored in
* the GemFire Cache.
* @see java.lang.Iterable
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Iterable
<
Gemstone
>
list
()
{
return
gemstoneRepo
.
findAll
();
return
this
.
gemstoneRepo
.
findAll
();
}
/**
* Saves the specified Gemstone to the GemFire Cache.
* <p/>
*
*
* @param gemstone the Gemstone to save in the GemFire Cache.
* @return the saved Gemstone.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
public
Gemstone
save
(
final
Gemstone
gemstone
)
{
Assert
.
notNull
(
gemstone
,
"The Gemstone to save must not be null!"
);
Assert
.
notNull
(
gemstone
.
getName
(),
"The name of the Gemstone must be specified!"
);
// NOTE deliberately (naively) validate the Gemstone after mutating data access in GemFire rather than before
// NOTE deliberately (naively) validate the Gemstone after mutating data access in
// GemFire rather than before
// to demonstrate transactions in GemFire.
Gemstone
savedGemstone
=
validate
(
gemstoneRepo
.
save
(
gemstone
));
Gemstone
savedGemstone
=
validate
(
this
.
gemstoneRepo
.
save
(
gemstone
));
Assert
.
state
(
savedGemstone
.
equals
(
get
(
gemstone
.
getId
())),
String
.
format
(
"Failed to find Gemstone (%1$s) in GemFire's Cache Region 'Gemstones'!"
,
gemstone
));
Assert
.
state
(
savedGemstone
.
equals
(
get
(
gemstone
.
getId
())),
String
.
format
(
"Failed to find Gemstone (%1$s) in GemFire's Cache Region 'Gemstones'!"
,
gemstone
));
System
.
out
.
printf
(
"Saved Gemstone (%1$s)%n"
,
savedGemstone
.
getName
());
...
...
@@ -133,9 +138,11 @@ public class GemstoneServiceImpl implements GemstoneService {
private
Gemstone
validate
(
final
Gemstone
gemstone
)
{
if
(!
APPROVED_GEMS
.
contains
(
gemstone
.
getName
().
toUpperCase
()))
{
// NOTE if the Gemstone is not valid, blow chunks (should cause transaction to rollback in GemFire)!
// NOTE if the Gemstone is not valid, blow chunks (should cause transaction to
// rollback in GemFire)!
System
.
err
.
printf
(
"Illegal Gemstone (%1$s)!%n"
,
gemstone
.
getName
());
throw
new
IllegalGemstoneException
(
String
.
format
(
"'%1$s' is not a valid Gemstone!"
,
gemstone
.
getName
()));
throw
new
IllegalGemstoneException
(
String
.
format
(
"'%1$s' is not a valid Gemstone!"
,
gemstone
.
getName
()));
}
return
gemstone
;
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/resources/spring-data-gemfire-cache.xml
View file @
1d5cddc1
<?xml version="1.0" encoding="utf-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:gfe=
"http://www.springframework.org/schema/gemfire"
xmlns:util=
"http://www.springframework.org/schema/util"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"
xmlns:gfe=
"http://www.springframework.org/schema/gemfire"
xmlns:util=
"http://www.springframework.org/schema/util"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
"
>
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
>
<util:properties
id=
"gemfireCacheConfigurationSettings"
>
<prop
key=
"name"
>
GemstonesSpringGemFireApp
</prop>
...
...
@@ -15,11 +13,13 @@
<prop
key=
"mcast-port"
>
0
</prop>
</util:properties>
<gfe:cache
properties-ref=
"gemfireCacheConfigurationSettings"
/>
<gfe:cache
properties-ref=
"gemfireCacheConfigurationSettings"
/>
<gfe:replicated-region
id=
"Gemstones"
ignore-jta=
"true"
persistent=
"false"
key-constraint=
"java.lang.Long"
value-constraint=
"sample.data.gemfire.domain.Gemstone"
/>
<gfe:replicated-region
id=
"Gemstones"
ignore-jta=
"true"
persistent=
"false"
key-constraint=
"java.lang.Long"
value-constraint=
"sample.data.gemfire.domain.Gemstone"
/>
<gfe:transaction-manager
id=
"transactionManager"
copy-on-read=
"true"
/>
<gfe:transaction-manager
id=
"transactionManager"
copy-on-read=
"true"
/>
</beans>
spring-boot-samples/spring-boot-sample-data-gemfire/src/test/java/sample/data/gemfire/SampleDataGemFireApplicationTest.java
View file @
1d5cddc1
...
...
@@ -16,8 +16,6 @@
package
sample
.
data
.
gemfire
;
import
static
org
.
junit
.
Assert
.*;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicLong
;
...
...
@@ -33,21 +31,18 @@ import sample.data.gemfire.domain.Gemstone;
import
sample.data.gemfire.service.GemstoneService
;
import
sample.data.gemfire.service.GemstoneServiceImpl.IllegalGemstoneException
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
* The SampleDataGemFireApplicationTest class is a test suite with test cases testing the
SampleDataGemFireApplication
* in Spring Boot.
*
<p/>
* The SampleDataGemFireApplicationTest class is a test suite with test cases testing the
*
SampleDataGemFireApplication
in Spring Boot.
*
* @author John Blum
* @see org.junit.Test
* @see org.junit.runner.RunWith
* @see org.springframework.boot.test.SpringApplicationConfiguration
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
* @see sample.data.gemfire.SampleDataGemFireApplication
* @since 1.0.0
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
SampleDataGemFireApplication
.
class
)
@SuppressWarnings
(
"unused"
)
public
class
SampleDataGemFireApplicationTest
{
@Autowired
...
...
@@ -68,7 +63,7 @@ public class SampleDataGemFireApplicationTest {
}
protected
Gemstone
createGemstone
(
final
String
name
)
{
return
createGemstone
(
ID_GENERATOR
.
incrementAndGet
(),
name
);
return
createGemstone
(
this
.
ID_GENERATOR
.
incrementAndGet
(),
name
);
}
protected
Gemstone
createGemstone
(
final
Long
id
,
final
String
name
)
{
...
...
@@ -87,45 +82,50 @@ public class SampleDataGemFireApplicationTest {
@Before
public
void
setup
()
{
assertNotNull
(
"A reference to the GemstoneService was not properly configured!"
,
gemstoneService
);
assertNotNull
(
"A reference to the GemstoneService was not properly configured!"
,
this
.
gemstoneService
);
}
@Test
public
void
testGemstonesApp
()
{
assertEquals
(
0
,
gemstoneService
.
count
());
assertTrue
(
asList
(
gemstoneService
.
list
()).
isEmpty
());
assertEquals
(
0
,
this
.
gemstoneService
.
count
());
assertTrue
(
asList
(
this
.
gemstoneService
.
list
()).
isEmpty
());
gemstoneService
.
save
(
createGemstone
(
"Diamond"
));
gemstoneService
.
save
(
createGemstone
(
"Ruby"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Diamond"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Ruby"
));
assertEquals
(
2
,
gemstoneService
.
count
());
assertTrue
(
asList
(
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
)));
assertEquals
(
2
,
this
.
gemstoneService
.
count
());
assertTrue
(
asList
(
this
.
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
)));
try
{
gemstoneService
.
save
(
createGemstone
(
"Coal"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Coal"
));
}
catch
(
IllegalGemstoneException
expected
)
{
}
assertEquals
(
2
,
gemstoneService
.
count
());
assertTrue
(
asList
(
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
)));
assertEquals
(
2
,
this
.
gemstoneService
.
count
());
assertTrue
(
asList
(
this
.
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
)));
gemstoneService
.
save
(
createGemstone
(
"Pearl"
));
gemstoneService
.
save
(
createGemstone
(
"Sapphire"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Pearl"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Sapphire"
));
assertEquals
(
4
,
gemstoneService
.
count
());
assertTrue
(
asList
(
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
)));
assertEquals
(
4
,
this
.
gemstoneService
.
count
());
assertTrue
(
asList
(
this
.
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
)));
try
{
gemstoneService
.
save
(
createGemstone
(
"Quartz"
));
this
.
gemstoneService
.
save
(
createGemstone
(
"Quartz"
));
}
catch
(
IllegalGemstoneException
expected
)
{
}
assertEquals
(
4
,
gemstoneService
.
count
());
assertTrue
(
asList
(
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
)));
assertEquals
(
createGemstone
(
"Diamond"
),
gemstoneService
.
get
(
"Diamond"
));
assertEquals
(
createGemstone
(
"Pearl"
),
gemstoneService
.
get
(
"Pearl"
));
assertEquals
(
4
,
this
.
gemstoneService
.
count
());
assertTrue
(
asList
(
this
.
gemstoneService
.
list
()).
containsAll
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
)));
assertEquals
(
createGemstone
(
"Diamond"
),
this
.
gemstoneService
.
get
(
"Diamond"
));
assertEquals
(
createGemstone
(
"Pearl"
),
this
.
gemstoneService
.
get
(
"Pearl"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment