Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
libraries
Mapper Service Configuration
Commits
934ee15b
Commit
934ee15b
authored
Oct 20, 2020
by
Jonas Waeber
Browse files
Refactor test locations
parent
3c187e09
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/test/kotlin/TestYamlParser.kt
deleted
100644 → 0
View file @
3c187e09
class
TestYamlParser
src/test/kotlin/TestFieldMapperSerde.kt
→
src/test/kotlin/
ch/memobase/test/
TestFieldMapperSerde.kt
View file @
934ee15b
package
ch.memobase.test
import
ch.memobase.mapping.fields.ConstantField
import
ch.memobase.mapping.mappers.ConstantFieldMapper
import
com.beust.klaxon.Klaxon
...
...
src/test/kotlin/ch/memobase/test/TestIdNormalizer.kt
0 → 100644
View file @
934ee15b
/*
* mapper-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
ch.memobase.test
import
ch.memobase.helpers.StringHelpers
import
java.util.stream.Stream
import
org.assertj.core.api.Assertions.assertThat
import
org.junit.jupiter.api.TestInstance
import
org.junit.jupiter.params.ParameterizedTest
import
org.junit.jupiter.params.provider.MethodSource
@TestInstance
(
TestInstance
.
Lifecycle
.
PER_CLASS
)
class
TestIdNormalizer
{
@ParameterizedTest
@MethodSource
(
"idExamples"
)
fun
`test
id
normalization`
(
params
:
Pair
<
String
,
String
>)
{
val
result
=
StringHelpers
.
normalizeId
(
params
.
first
)
assertThat
(
result
).
isEqualTo
(
params
.
second
)
}
private
fun
idExamples
()
=
Stream
.
of
(
Pair
(
"J2.143#1996/386#414-3#1*"
,
"J2_143_1996_386_414-3_1*"
),
Pair
(
" IB Becker Audiovisuals-2"
,
"IB_Becker_Audiovisuals-2"
),
Pair
(
" oisadi "
,
"oisadi"
),
Pair
(
"Test mit vielen spaces . jal"
,
"Test_mit_vielen_spaces_jal"
),
Pair
(
"test___underscores"
,
"test_underscores"
)
)
}
src/test/kotlin/TestMappingParser.kt
→
src/test/kotlin/
ch/memobase/test/
TestMappingParser.kt
View file @
934ee15b
package
ch.memobase.test
import
ch.memobase.mapping.MappingConfigurationParser
import
ch.memobase.mapping.fields.FieldParsers
import
ch.memobase.mapping.mappers.RicoConceptMapper
...
...
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